Repository navigation
Conversation
…ortal shadow root Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VD8gaUA7K5gseR3E5X8cBA
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 6 of the Phase −1 bug-fix stack.
Overlay/Overlay.tsx):role="button"becamerole="presentation", and theprefer-tag-over-roledisable comment was removed because it's no longer needed. Escape already handles keyboard dismissal.tabIndex={-1}is unchanged (see notes).Modal/useModalDrag.ts,Modal/Modal.module.css):closingSignis now based on the side the drawer is attached to:startin LTR andendin RTL close toward negative x.[dir="rtl"]. Before, it only allowed negative drag forstartand positive drag forend, so fixing the JS alone wouldn't render the drag.position === "start". LTR behaviour is unchanged._private/Portal/Portal.tsx): the bug reproduces. The detector<div>is removed after mount, so any later render readrootRef.current === nulland moved the portal content todocument.body. The detected shadow root is now stored in a ref.fix/selectbrings in a fix for a type error in a fix(select): listbox semantics, multiple selection, trigger label, first option value #685 test story (renderValueis required withmultiple).Tests (each of these fails on the base branch and passes here):
Overlay.stories.tsx: theclassName, attributesstory now assertsrole="presentation".Portal.stories.tsx: newtest: shadow root, which re-renders and checks the content stays in the shadow root.Modal.stories.tsx: newtest: rtl swipe direction, which uses native Touch events. The existingonClose, onAfterOpen, onAfterClosestory found the backdrop via its oldbuttonrole and now queriespresentation.Related Issue
Phase −1 of the headless-extraction plan.
Screenshots / Recordings
The RTL
start/enddrawers now follow the finger when swiped to close. No other visual changes.Notes for Reviewers
fix/select).tabIndex={-1}: I kept it to avoid changing focus behaviour when clicking the backdrop. axe has a best-practice rule (presentation-role-conflict) for focusable elements withrole="presentation". DroppingtabIndexmight be worth a separate look.Modal > onClose, onAfterOpen, onAfterClosefailure in the base-line run onmainwas a one-off flake. It passes consistently here after the query update.pnpm lintpasses andtscpasses.pnpm test:browserhas 622 passing and 1 failing,Image > onLoad, which also fails onmainin this sandbox because it has no network access.Generated by Claude Code