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

Support for React Portal inside the list #88

Open
ivan7237d opened this issue Jul 25, 2022 · 1 comment
Open

Support for React Portal inside the list #88

ivan7237d opened this issue Jul 25, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@ivan7237d
Copy link

There is an error that occurs when you're using a React Portal inside a list item, in my case a Modal from react-bootstrap.

When a keyboard event is dispatched inside the portal, it bubbles up the React component tree to react-movable's onKeyDown handler, which calls checkIfInteractive(target: Element, rootElement: Element). But in this case the DOM tree doesn't match the React tree, and because of that target is not a descendant of rootElement. As a result, in the code inside checkIfInteractive, target ends up being null, and an error is thrown at this line:

if (target.getAttribute('data-movable-handle')) {

@cheton
Copy link
Contributor

cheton commented Feb 6, 2024

It will be great to have an option of including a user-defined checkIfInteractive prop for specific purposes.

@tajo tajo added the enhancement New feature or request label Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants