Forums › Forums › Bug Reports › JS bug in "Content Toggle" element
-
JS bug in "Content Toggle" element
-
I have the following bug with the “Content Toggle” Element:
Effects:
* Opening an Elememt in frontend needs 2 clicks
* Option “Show only one panel at a time” is not working properly
* On the console, I get the following JS error:
front.build.js?ver=2.3.8:70 Uncaught TypeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node'. at front.build.js?ver=2.3.8:70 at Array.forEach (<anonymous>) at HTMLDivElement.<anonymous> (front.build.js?ver=2.3.8:66)
My environment:
WP 5.4.2, Ultimate Blocks Plugin Version 2.3.8, Browser: Chrome Version 83 (Windows 10)
Fix:
In /wp-content/plugins/ultimate-blocks/src/blocks/content-toggle/front.build.js, replace line 70:
if (!siblingContent.contains("ub-hide")) {
With:
if (!siblingContent.contains(instance.querySelector("ub-hide"))) {
-
Hi @Benno ! Thanks for informing us about this issue. We’ve managed to reproduce it in our end, and we’ve made a fix that’s not far from what you suggested. We’ll be including it in our next release.
We’ll let you know when it comes out. If you encounter further issues with the plugin, please let us know.
Regards.