From 0358df3b0a8e77630cdf9dbe90ac83d0db4b8f68 Mon Sep 17 00:00:00 2001 From: shgeum Date: Sat, 20 May 2023 00:04:40 +0900 Subject: [PATCH] Workaround: trigger transitionend manually --- src/FilterItem/FilterItem.ts | 3 +++ src/Filterizr/Filterizr.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/FilterItem/FilterItem.ts b/src/FilterItem/FilterItem.ts index a4af19e..5653d6e 100644 --- a/src/FilterItem/FilterItem.ts +++ b/src/FilterItem/FilterItem.ts @@ -82,6 +82,9 @@ export default class FilterItem extends FilterizrElement { public getSortAttribute(sortAttribute: string): string | number { return this.sortData[sortAttribute]; } + public refresh(): void { + this.trigger('transitionend'); + } protected bindEvents(): void { this.eventReceiver.on('transitionend', (): void => { diff --git a/src/Filterizr/Filterizr.ts b/src/Filterizr/Filterizr.ts index c3839bd..ee7fae9 100644 --- a/src/Filterizr/Filterizr.ts +++ b/src/Filterizr/Filterizr.ts @@ -224,6 +224,10 @@ export default class Filterizr implements Destructible { itemsToFilterIn.forEach((filterItem, index): void => { filterItem.filterIn(itemsPositions[index]); }); + // Workaround: trigger transitionend manually + filterItems.getFilteredOut(options.filter).forEach((filterItem): void => { + filterItem.refresh(); + }); } /**