Clean Filters with Select dropdownlist


Topic: Clean Filters with Select dropdownlist

neocheck pro premium asked 2 weeks ago

I am developing a filter view where some filters are dropdown lists. When selecting an option and then clearing the filters, the previously selected option remains. The issue is that I cannot clear it with my filter-clearing function because the component is created and destroyed in the DOM when the dropdown list is expanded and collapsed. Is there any method or function to clear the selected options in the dropdown?


Kamila Pieńkowska staff answered 2 weeks ago

Please add a snippet with a working example as it is hard to understand your use case based solely on short description.


neocheck pro premium answered 7 days ago

The snippet: https://mdbootstrap.com/snippets/standard/neocheck/6345531

The filter cleans up its previous value appropriately. The problem is because there is an element that is created and destroyed from the DOM, which we are not managing. This is created when the list of options is displayed and undone when it is no longer displayed. Once the filter has been cleaned, when this element reappears in the DOM, it displays the value previously selected in the filter.

The Unhandled Element: https://mdbootstrap.com/snippets/standard/neocheck/6345538


Kamila Pieńkowska staff answered 6 days ago

Here is a snippet demonstrating how to clear a select filter: https://mdbootstrap.com/snippets/standard/kpienkowska/6346183


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.2.0
  • Device: Notebook
  • Browser: Google Chrome
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: No