Open dsoffer opened 1 month ago
I believe https://github.com/adobe/react-spectrum/issues/2403 is the root cause for this issue. What use case have you observed this performance hit with?
When the drop zones have a lot of thigns to render , which it does in our case at times, it re renders all of it which causes performance issues
Provide a general summary of the issue here
When using useDrag when one clicks the mouse and then the keyboard and alternate in this pattern, the hook event listeners (keyup/keydown) will cause the whole dragzone to rerender, this can cause performance issues
๐ค Expected Behavior?
I would expect for these zones not to rerender, atleast give me an option to disable the keyboard listeners when using useDrag
๐ฏ Current Behavior
The drag/drop zones and their content get rerendered
๐ Possible Solution
Ability to turn off keyboard listeners when using useDrag
๐ฆ Context
This is affecting me because it rerenders everything inside the drop container, and it can cause lag when there is a lot of content in there (even though the content is memoed it still rerenders the whole thing)
๐ฅ๏ธ Steps to Reproduce
go to the sample drag and drop part in the documentation https://react-spectrum.adobe.com/react-aria/useDrag.html , put up the profiler to high light rerenders, alternate clicking mouse + pressing a keyboard key. You will see the drag/drop zones rerender everytime
Version
3.6
What browsers are you seeing the problem on?
Firefox, Chrome
If other, please specify.
No response
What operating system are you using?
MACOS
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response