Topic: Wysiwyg - dropdowns open and immediately close
meesha81 priority asked 5 months ago
This bug can be (and IMHO is) connected to my previous reported bug with dropdowns: https://mdbootstrap.com/support/standard/dropdown-unable-to-init-dropdown-after-content-dynamical-reload/
I can tell you, that I have find out during this bugreport that behavior is the same with my common dropdown bugreport. Only difference is animation on|off. With animation, you can see double event - open and close. Without animation you can se "nothing".
What is wrong: If you init WYSIWIG and then reload content dynamically and do once more init, dropdowns (text color, styles etc.) are not usable, because after open they are immediatelly closed. It looks like chaining events. Disponse do not destroy dropdowns events or dropdowns have problem with invalid removing from dom (some events remains..?).
- Open snippet
- Click INIT => wysiwyg = CORRECT
- Reload content => wysiwyg lost = CORRECT
- Click INIT => wysiwyg looks fine, BUT DROPDOWN menu is not usable, becase is closed immediatelly.
https://mdbootstrap.com/snippets/standard/meesha81/6141805
So this bug is probably consequence of bug in dropdown menus described in my previous bugreport.
Grzegorz Bujański staff answered 5 months ago
Yes. This is a bug related to a bug in dropdowns. We are already working on a solution.
wealthtechs priority commented 2 months ago
I have the same issue, do you have an ETA for the fix? I can add that disposing the instance of the element does not solve the problem, I have tried restarting it using the dispose method then Dropdown.getOrCreateInstance class, also something that seems strange to me is that through the API (element instance) I can open and close the dropdown I mean the show() hide() and toggle() methods work well, the problem is when doing click on the button that opens and closes it instantly
Grzegorz Bujański staff commented 2 months ago
This bug has been fixed in version 7.3.2. Update the MDB to the latest version, and if this issue still exists in your project, create a snippet that will allow us to reproduce this issue.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 7.3.1
- Device: PC
- Browser: Chrome
- OS: Win11
- Provided sample code: No
- Provided link: Yes
cassie2698bratt free commented 5 months ago
Hello,
You suspect the WYSIWYG dropdown issue is related to a previously reported bug (https://mdbootstrap.com/docs/standard/components/dropdowns/). Both involve dropdowns not working after content reload and re-initialization. You believe it might be an event chaining issue where the open event triggers the close event immediately. The provided snippet ([https://mdbootstrap.com/docs/standard/components/dropdowns/] https://www.marykayin-touch.com (https://mdbootstrap.com/docs/standard/components/dropdowns/)) seems to confirm this behavior.
meesha81 priority commented 5 months ago
Yes, this problem is also in mdb page, also "profile" button top right at: https://mdbootstrap.com/docs/standard/content-styles/icons/ So I hope it will be fixed soon, because it is critical with high impact...
marykayintouch free commented 2 months ago
The issues you are facing are likely related to improper cleanup or event handling conflicts. By carefully managing event listeners, properly cleaning up components, and ensuring correct initialization, you can resolve these problems. https://marykayintouch.cloud/ If you continue to experience difficulties, consider creating a minimal reproducible example and seeking help from community forums or support channels related to the libraries or frameworks you are using.