- πΊπΈUnited States aaronpinero
I visited this issue because I am experiencing inconsistent results with the module. Sometimes the JavaScript for the hierarchical taxonomy menu will load properly and sometimes it will not. That is, the JavaScript appears in the HTML in a script tag but none of the code inside is being executed. This makes me think that because Drupal behaviors are not being used, the JS is running before the menu block is fully rendered and none of the event handlers for opening and closing submenus are being applied.
I added the attached patch against the 2.0.x branch (created a new one since the last one is quite old) and it seems like the issue has been resolved.
- Status changed to Needs review
3 months ago 2:45pm 15 August 2024 - πΊπΈUnited States aaronpinero
I am adding an updated patch. I encountered a situation where, as described in one of the earlier comments, the submenus open and then immediately close. I believe this is because the JavaScript is not using core/once as a dependency. Inspecting the menu in the browser showed that the event handler for toggling open the submenus was being added multiple times.
The updated patch uses 'once' to make sure this doesn't happen. I added a relationship to another old issue that also suggested using 'once' in the JavaScript.
I am marking this now as Needs Review.