fix: Safari DevTools icon rendering with isolation: isolate#10675
fix: Safari DevTools icon rendering with isolation: isolate#10675xxiaoxiong wants to merge 1 commit intoTanStack:mainfrom
Conversation
Fixes TanStack#10633 Problem: The TanStack Query DevTools icon is not rendering properly in Safari. The pill-shaped background is not being cropped correctly, causing visual artifacts. Root Cause: Safari has issues with nested overflow: hidden + absolute positioning + negative margins. The background blur div extends beyond the container bounds (top/left/right/bottom: -8px) and Safari doesn't properly clip it despite overflow: hidden on the parent. Solution: Add 'isolation: isolate' to the devtoolsBtn container. This creates a new stacking context that forces Safari to properly respect the overflow: hidden boundary. The isolation property is specifically designed to fix rendering issues with filters and blending modes in nested contexts. Changes: - packages/query-devtools/src/Devtools.tsx - Add 'isolation: isolate' to devtoolsBtn CSS Impact: - Fixes the visual rendering bug in Safari - No impact on other browsers (isolation: isolate is well-supported) - No functional changes, only visual fix
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds the ChangesDev Tools Button Style Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes #10633
This PR fixes a Safari-specific rendering bug where the TanStack Query DevTools icon is not rendering properly. The pill-shaped background was not being cropped correctly, causing visual artifacts.
Problem
In Safari, the DevTools icon background extends beyond the intended pill shape, creating a visual rendering issue. The icon should appear as a clean pill with the background properly cropped to the rounded border.
Root Cause
Safari has issues with nested
overflow: hidden+ absolute positioning + negative margins. The background blur div extends beyond the container bounds (top/left/right/bottom: -8px) and Safari doesn't properly clip it despiteoverflow: hiddenon the parent container.Solution
Add
isolation: isolateto thedevtoolsBtncontainer. This creates a new stacking context that forces Safari to properly respect theoverflow: hiddenboundary. Theisolationproperty is specifically designed to fix rendering issues with filters and blending modes in nested contexts.Why
isolation: isolateworksoverflow: hiddenclippingChanges
packages/query-devtools/src/Devtools.tsxisolation: isolatetodevtoolsBtnCSS (line 2760)Testing
Before/After
Before (Safari):
After (Safari):
Browser Compatibility
isolation: isolateis supported in:References
Summary by CodeRabbit