It appears that that foundation's JavaScript was not able to apply to dynamically loaded elements. This is because foundation's JS is implemented at the bottom of the html.html.twig file instead of in a Drupal behavior.
I came across this error when I was using Big Pipe and applying foundation's Dropdown functionality to the language selector block.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | zurb_foundation-js_init_in_drupal_behavior-2833798.patch | 1.29 KB | chrissnyder |
Comments
Comment #2
chrissnyderThis patch should correct this issue. It places the foundation init code into a Drupal behavior. The advantage to this is that we are able to use
contextto only apply the foundation js to the newly added DOM.Comment #3
chrissnyderComment #4
bygeoffthompson commentedThis patch resolved the console error I was receiving on a fresh Drupal 8 installation with zurb_foundation as my front-end theme. Applying the patch allowed me to place "- core/jquery" as a dependency to my library(ies).
Thanks!
Comment #5
hongpong commentedThis seems appropriate, the inline Javascript in the theme does not match Drupal's preferred practices.
Comment #6
serg2 commentedTested and seems like a sensible move.
Comment #8
samuel.mortensonCommitted, thanks all!