[menu] Fix race conditions#3821
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
1808988 to
d8e331a
Compare
Greptile SummaryFixed two race conditions in the menu component's hover and focus handling:
These race conditions were difficult to reproduce under normal conditions but became more obvious with CPU slowdown or when dealing with many submenu triggers. Confidence Score: 5/5
Important Files Changed
|
| () => ({ | ||
| type: 'submenu-trigger' as const, | ||
| setActive: () => parentMenuStore.set('activeIndex', listItem.index), | ||
| setActive() { |
There was a problem hiding this comment.
Any particular reason for this change?
There was a problem hiding this comment.
No, was just testing things. I left it because I prefer the formatting
d8e331a to
909603c
Compare
Found a couple of these working on #3783
onFocusgets called afteronPointerLeaveis called withnullincorrectly.Both are hard to reproduce; more frequent with CPU slowdown