Skip to content

Conversation

lydell
Copy link

@lydell lydell commented Jun 1, 2025

Closes #105 together with elm/virtual-dom#187

The code already sets __VirtualDom_divertHrefToApp before each render, so that <a> elements created during the render can get a click listener that directs the link click to the update function, letting it decided what should happen. https://github.com/elm/browser/blob/1.0.2/src/Elm/Kernel/Browser.js#L81-L87

This PR also sets __VirtualDom_divertHrefToApp before virtualization, so that <a> HTML elements that are picked up by Elm during initialization also can get their click listener – which is implemented in elm/virtual-dom#187.

Note to those following along: This PR is included in https://github.com/lydell/browser/tree/safe, which is part of https://github.com/lydell/elm-safe-virtual-dom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken links in Browser.application with prerendered content
1 participant