After some days of debugging, I’ve come across the root problem to an issue and am unsure how to approach from here - mostly curious if this has been seen before, if it’s considered a Foundation bug (I believe it is), or if there is some other way around the issue.
I work on a team that builds/designs for WordPress, we have a boilerplate theme based off of Foundation and also some plugins of our own. One plugin is called Courier Notices. Notices can be displayed in the header, footer, or as a modal. As much as we love Foundation, it is not tied to Foundation by any means. It’s built to work standalone.
The problem we came across is seeing the modal appear twice. After quite a bit of time debugging our plugin we found the root of the problem to be that we display the modal with window.onload (https://github.com/linchpin/courier-notices/blob/5e276c534913413da0b7cdb80ecbd28153f1c3d7/assets/js/frontend/modal.js#L13) but in the Foundation Sites node_module foundation.util.triggers.js:246, an onLoad listener is added which causes our modal to fire a second time. I’ve confirmed by commenting out the onLoad within Triggers.init and recompiling the theme’s JS.
To me, this seems like a bug within Foundation as the Foundation listener should only trigger Foundation elements.
Has this issue been seen before?