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

[LoginOverlay] Events on slotted content do not work #269

Open
sissbruecker opened this issue Nov 8, 2024 · 0 comments
Open

[LoginOverlay] Events on slotted content do not work #269

sissbruecker opened this issue Nov 8, 2024 · 0 comments
Labels

Comments

@sissbruecker
Copy link
Contributor

When adding a button with a click handler to the login overlay's footer or custom form area, then the handler is never called when clicking the button:

<LoginOverlay opened>
    <div slot="footer">
        <button onClick={() => console.log('click')}>foo</button>
    </div>
</LoginOverlay>

It looks like the web component contains some logic for teleporting the content from the base element to the overlay, thus manipulating the DOM rendered by React, which might then interfere with React's event system.

Instead we should probably use whatever solution other React components like Dialog use to teleport the content. Might also be an opportunity to add a more React-like API where a JSX element is passed as a prop for example.

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

No branches or pull requests

2 participants