Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No hook found for custom element #3496

Closed
philipbrown opened this issue Nov 11, 2024 · 0 comments · Fixed by #3500
Closed

No hook found for custom element #3496

philipbrown opened this issue Nov 11, 2024 · 0 comments · Fixed by #3500

Comments

@philipbrown
Copy link

Environment

  • Elixir version (elixir -v): 1.17.1
  • Phoenix version (mix deps): 1.7.14
  • Phoenix LiveView version (mix deps): 1.0.0-rc.7
  • Operating system: macOS
  • Browsers you attempted to reproduce this bug on (the more the merrier): Safari
  • Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: Yes

Actual behavior

I've got 2 pages, one with a sticky component and one without. The sticky component includes a hook. The page without the sticky component also includes the same hook. Both the elements with the hook have the same id. When clicking on a link from the page with the sticky component to the page without the sticky component, I get the following error:

CleanShot 2024-11-11 at 15 58 48@2x

Here is a reduced test case: https://github.com/philipbrown/sticky-error

I'd love to also provide a PR for this, but I have no idea how to fix it.

Thank you! 💜

SteffenDE added a commit that referenced this issue Nov 11, 2024
Fixes #3496.

When navigating from a sticky LiveView to another page that contains
a hook on an element with the same id, morphdom would merge the old
element into the new one and still find the old HOOK_ID in the element's
DOM.private data, leading to the new hook not initalizing properly.
SteffenDE added a commit that referenced this issue Nov 11, 2024
Fixes #3496.

When navigating from a sticky LiveView to another page that contains
a hook on an element with the same id, morphdom would merge the old
element into the new one and still find the old HOOK_ID in the element's
DOM.private data, leading to the new hook not initializing properly.
chrismccord pushed a commit that referenced this issue Nov 13, 2024
Fixes #3496.

When navigating from a sticky LiveView to another page that contains
a hook on an element with the same id, morphdom would merge the old
element into the new one and still find the old HOOK_ID in the element's
DOM.private data, leading to the new hook not initializing properly.
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 a pull request may close this issue.

1 participant