Removing focused element inside dialog or dropdown makes CPU spike in chrome.
See original GitHub issueBug report
Current Behavior
Removing focused element inside dialog or dropdown makes CPU spike. Possibly due to focus trapping logic.
Expected behavior
CPU spike shouldn’t happen
Reproducible example
https://codesandbox.io/s/confident-pasteur-30gc2q
Suggested solution
Manually handling focus trap as suggested here works https://github.com/radix-ui/primitives/issues/1498#issuecomment-1194346289
document.addEventListener('focusout', (event) => {
if (event.relatedTarget === null) container.focus();
})
Additional context
Related issue: https://github.com/radix-ui/primitives/issues/1498#issuecomment-1194346289
This works fine on other OS.
Your environment
| Software | Name(s) | Version |
|---|---|---|
| Radix Package(s) | Dialog | 1.0.0 |
| React | n/a | 17 |
| Browser | Chrome (MacOS) | 103.0.5060.53 |
| Assistive tech | ||
| Node | n/a | |
| npm/yarn | ||
| Operating System | MacOS | all |
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:11
Top Results From Across the Web
10 frustrating Google Chrome irritations and how to fix them
Here, we'll show you how to make Chrome less annoying—and that sweet, serene sanity is worth more than a thousand experimental features.
Read more >Get actionable insights on your website's performance
For this tutorial, check Disable cache and set CPU to 4x slowdown in the drop-down menu: Throttling. Gotchas. Throttling is relative to your ......
Read more >5212 - BUG: Chrome does not respond to a mouse click at times
Just a simple right click on a link to open in a new tab, and I'm pounding on my touchpad (or buttons, makes...
Read more >Set Chrome policies for users or browsers - Google Support
Selecting Enable Active Directory Management lets you manage ChromeOS devices using Microsoft Active Directory or your Admin console. Use the Device management ...
Read more >CPU limits | Cloud Run Documentation
By default, each container instance is limited to 1 CPU. You can increase this using any integer value up to a maximum of...
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 Free
Top 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

Yeah I see it now. Given that sandbox from @dsdeur, it seems to be a bug in Chrome itself to be honest. We’ll see if we can get around it.
You can do this already on the
Contentpart: