tajo / react-movable

🔀 Drag and drop for your React lists and tables. Accessible. Tiny.
https://react-movable.pages.dev
MIT License
1.55k stars 51 forks source link

The onKeyDown handler eats the event of any nested Textarea.onChange handlers. #23

Closed shenders13 closed 4 years ago

shenders13 commented 5 years ago

Hi React-Movable folks,

Just a heads up - a text area component that was deeply nested inside a renderItem wasn't receiving an onChange event when the text area was updated.

The fix was to remove the onKeyDown props that was being applied way up the component tree.

May be worth adding this to the docs as it was super tricky to debug.

Thanks for your awesome library.

Best wishes,

Sam

tajo commented 5 years ago

Yea, I think this is related to https://github.com/tajo/react-movable/issues/15

Should be fixable.

tajo commented 4 years ago

Fixed and released.

andrewringler commented 4 years ago

This seems to still be an issue. I forked the sandbox from the README and added the InteractiveItems example from the repo. I can edit the input form but I cannot types spaces into the input field, see sandbox here:

https://codesandbox.io/s/basic-react-movable-forked-01ebo

Additionally, while testing locally I am seeing this issue even when using the data-movable-handle. I had thought that if I had a handle somewhere in my item than any other element would not have input events captured. It might be worth adding something like a data-movable-interactive attribute that users can add to their own interactive elements to signify that they don't want any react-movable events captured on them.

tajo commented 4 years ago

@andrewringler It got fixed in v2.4, the codesandbox example was using v2.0. I've updated that. Thanks.

andrewringler commented 4 years ago

Aaah. Thanks.