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.

Comments

chrissnyder created an issue. See original summary.

chrissnyder’s picture

Status: Active » Needs review
StatusFileSize
new1.29 KB

This 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 context to only apply the foundation js to the newly added DOM.

chrissnyder’s picture

Assigned: chrissnyder » Unassigned
bygeoffthompson’s picture

This 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!

hongpong’s picture

This seems appropriate, the inline Javascript in the theme does not match Drupal's preferred practices.

serg2’s picture

Status: Needs review » Reviewed & tested by the community

Tested and seems like a sensible move.

samuel.mortenson’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.