Hover behavior on top of JS for `Table` has performace issues
See original GitHub issueReproduction link
Steps to reproduce
- Open the link
- Try to scroll to see frezzing of hover behavior
- Slowdown CPU to make sure more clearly (
devtools
→Performance
→CPU *x slowdown
)
What is expected?
Hovering styles, such as background should be declared using CSS only
What is actually happening?
JS is handled hover behavior, and change a className for each row. It’s creates the performance issues especially for cases with grouped rows (eg rowSpan
)
Environment | Info |
---|---|
antd | > 4.17.0 |
React | 18.1 |
System | mac OS |
Browser | Chrome 100 |
Hi 👋 This is actually clone of https://github.com/ant-design/ant-design/issues/35395 issue, it looks like the problem is still there, so i’m trying again Is there are any side effect except changing a background that forces using JS to handle hover? PS Maybe give an opportunity to turn-off hover behavior complete for performance sensitive cases
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Slow response when the HTML table is big - Stack Overflow
The first thing that is slowing your loop down is .insertRow() . You're doing this at the top of your loop and then...
Read more >A Guide To Hover And Pointer Media Queries
Media Query Hover: Detecting a Pointer #. The hover media query allows us to detect the user's primary input mechanism can hover over...
Read more >Element: mouseenter event - Web APIs | MDN
With deep hierarchies, the number of mouseover events sent can be quite huge and cause significant performance problems.
Read more >Moving the mouse: mouseover/out, mouseenter/leave
The mouseover event occurs when a mouse pointer comes over an element, and mouseout – when it leaves. These events are special, because...
Read more >Popovers · Bootstrap v5.0
For disabled popover triggers, you may also prefer data-bs-trigger="hover focus" so that the popover appears as immediate visual feedback to your users as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reference:antd表格性能差的解决方案 Use custom cell render to remove hover events:
@alienzhangyw thanks, it’s much faster
https://user-images.githubusercontent.com/33288402/167868669-86922631-4d0a-4b13-a8d9-80db396346c6.mov