diff --git a/explorer/frontend/components/Filter.jsx b/explorer/frontend/components/Filter.jsx index dfa4b5b0e..a2a90c1be 100644 --- a/explorer/frontend/components/Filter.jsx +++ b/explorer/frontend/components/Filter.jsx @@ -118,7 +118,7 @@ const FilterModal = ({ isVisible, title, type, isSearchEnabled, options, onSearc ); }; -const Filter = ({ isSelectedItemsShown, data, value, search, isDisabled, onChange }) => { +const Filter = ({ isSelectedItemsShown, data, value, search, isDisabled, onChange, onClear }) => { const { t } = useTranslation(); const [expandedFilter, setExpandedFilter] = useState({}); const [selectedItems, setSelectedItems] = useState({}); @@ -138,7 +138,11 @@ const Filter = ({ isSelectedItemsShown, data, value, search, isDisabled, onChang const getTextStyle = name => `${styles.text} ${isFilerActive(name) ? styles.textActive : null}`; const clear = () => { setExpandedFilter(null); - onChange({}); + if (onClear) { + onClear(); + } else { + onChange({}); + } }; const handleFilterPress = filter => { if (!isFilterAvailable(filter.name)) { diff --git a/explorer/frontend/pages/accounts/[address].jsx b/explorer/frontend/pages/accounts/[address].jsx index b762a7097..d9fc2b257 100644 --- a/explorer/frontend/pages/accounts/[address].jsx +++ b/explorer/frontend/pages/accounts/[address].jsx @@ -269,6 +269,7 @@ const AccountInfo = ({ accountInfo, preloadedTransactions }) => { isDisabled={transactionPagination.isLoading} value={transactionPagination.filter} onChange={transactionPagination.changeFilter} + onClear={transactionPagination.clearFilter} search={search} />