Skip to content

docs(BottomSheet): where focus lands on open in WebKit, and data-autofocus for a field - #12487

Merged
cixzhang merged 4 commits into
mainfrom
lane2/bottomsheet-doc-initial-focus
Nov 20, 2026
Merged

cixzhang merged 4 commits into
mainfrom
lane2/bottomsheet-doc-initial-focus

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A builder reads BottomSheet's docs to learn where focus lands when a sheet opens with no data-autofocus field. The docs named Chromium (the panel) and Firefox (the first focusable control) and said nothing about Safari. In Safari on iOS a modal sheet lands on its panel, as in Chromium, so a builder who expected the first control there got the panel. The docs now name that landing and say to mark the field data-autofocus (a TextInput with hasAutoFocus) to open on it in every browser (component:BottomSheet AR4).

Docs only: one sentence in BottomSheet.doc.mjs and a [docs] Changeset, since the doc ships with the package. No behavior, prop or record changes.

Evidence

  • Safari on iOS (iOS 26.2 simulator, installed web app): a modal BottomSheet whose content starts with a <button> and has no data-autofocus field opens; once the rise settles, document.activeElement is the sheet's panel (the tabindex="-1" container inside the <dialog>), not the button.
  • Not measured, so not claimed: desktop Safari, and a non-modal (hasScrim={false}) sheet in Safari. The sentence names only the modal sheet on iOS. BottomSheetReplace.test.tsx models a lone non-modal Safari sheet taking no focus on open, which the sentence does not contradict.

Overlap checked: #12216, #12179, #12081, #12044, #11859, #10462, #8217, #8080 (they change other lines of BottomSheet.doc.mjs; none touches the open-focus sentence)

Test plan

  • check:changesets, check:knowledge and check:sync pass.
  • Prettier clean; the doc module loads.

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 20, 2026 3:07am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 20, 2026, 4:41 AM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec f2ad133

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 72653a5

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
BottomSheet 75.3 kB (0) · 7.8 kB CSS (0) — — · ✓ · —
BottomSheetSwitcher 18.8 kB (0) · 3.4 kB CSS (0) — — · ✓ · —

Package size: @astryxdesign/core 7.84 MB packed (+22 B); no new dependencies.

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the new WebKit clause needs a Safari result or narrower wording before this can be approved.

  • The release note and the new BottomSheet.doc.mjs text say a sheet with no data-autofocus field lands on the panel in WebKit (Safari, iOS Safari included), modal or not, but the pull request shows no Safari result and BottomSheetReplace.test.tsx:1511-1512 models a lone non-modal Safari sheet taking no focus, so please state in the description where focus landed in desktop and iOS Safari for a modal and a non-modal sheet without a field, or narrow the clause to what you reproduced.

The data-autofocus instruction matches the component's accessibility contract, and the public API is unchanged.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the docs named only Chromium and Firefox before this change. Verified against the base doc text.
  • Claim: WebKit and iOS Safari land on the panel with no field, modal or not. Not shown (the blocking finding above).
  • Claim: marking a field data-autofocus opens on it in every browser. Verified against the accessibility contract and the cross-browser autofocus test.
  • Claim: the change is docs only, with no behavior, prop or record change. Verified: two files, and the built API surface is identical. The doc edit rewrites one sentence and adds a second.
  • Claim: the listed overlapping pull requests do not touch the open-focus sentence. Verified: none edits the description line.
  • Claim: the changeset, knowledge and sync checks pass, Prettier is clean and the doc module loads. Verified by rerunning them on this head.
  • File .changeset/bottomsheet-doc-webkit-initial-focus.md: the blocking finding above (its WebKit claim); the format is valid.
  • File packages/core/src/BottomSheet/BottomSheet.doc.mjs: the blocking finding above; consistent with the release note.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 496b4b3

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet.

The doc and the release note now name only the case the description measured, a modal sheet in Safari on iOS landing on its panel, and the public API is unchanged.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: before this change the docs named only Chromium (the panel) and Firefox (the first focusable control). Verified against the base doc text.
  • Claim: in Safari on iOS a modal sheet with no data-autofocus field lands on its panel. Verified as stated in the description's iOS simulator run, and consistent with the sheet's open-focus code, which focuses a modal sheet's panel when the native steps leave focus outside it.
  • Claim: the docs now name that landing and say to mark a field data-autofocus to open on it in every browser. Verified in BottomSheet.doc.mjs:175; the data-autofocus rule matches the component's accessibility contract and its cross-browser autofocus test.
  • Claim: docs only, with no behavior, prop or record change, and the doc ships with the package. Verified: two files, identical built API surfaces, and the package publishes src; the doc edit rewrites one clause and adds one sentence.
  • Claim: desktop Safari and a non-modal Safari sheet are not claimed. Verified: the doc and the release note name only the modal sheet on iOS.
  • Claim: the listed overlapping pull requests change other lines of the doc file and none touches the open-focus sentence. Verified: none edits the description line.
  • Claim: the changeset, knowledge and sync checks pass, Prettier is clean and the doc module loads. Verified by rerunning them on this head.
  • Changeset entry: a docs patch for core describing the modal-sheet-on-iOS landing and the data-autofocus instruction. Verified against the doc text; the changeset check accepts it.
  • File .changeset/bottomsheet-doc-webkit-initial-focus.md: clear.
  • File packages/core/src/BottomSheet/BottomSheet.doc.mjs: clear, consistent with the release note.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 157ef71

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: CI passed on this head.

The doc and the release note name only the case the description measured, a modal sheet in Safari on iOS landing on its panel, and the public API is unchanged.

Claims and files checked

Review mode: same-head; reason: none

  • Claim: before this change the docs named only Chromium (the panel) and Firefox (the first focusable control) for where focus lands on open. Verified against the base doc text.
  • Claim: in Safari on iOS a modal sheet with no data-autofocus field lands on its panel. Verified as stated in the description's iOS simulator run, and consistent with the sheet's open-focus code, which keeps the native landing inside a modal sheet and focuses its panel only when focus is outside it.
  • Claim: the docs now name that landing and say to mark a field data-autofocus (a TextInput with hasAutoFocus) to open on it in every browser. Verified in BottomSheet.doc.mjs:178; the rule matches the component's accessibility contract, its cross-browser autofocus test, and TextInput, which marks the field when hasAutoFocus is set.
  • Claim: docs only, with no behavior, prop or record change, and the doc ships with the package. Verified: two files, identical built API surfaces, no record touched, and the package publishes src.
  • Claim: desktop Safari and a non-modal Safari sheet are not claimed, and the non-modal unit test does not contradict the sentence. Verified: the doc and the release note name only the modal sheet on iOS, and the test models a lone non-modal sheet taking no focus.
  • Claim: none of the listed overlapping pull requests touches the open-focus sentence. Verified live: none changes it; four no longer change the doc file, three change only the height prop description, and one has merged with a theming-target change only.
  • Claim: the changeset, knowledge and sync checks pass, Prettier is clean and the doc module loads. Verified by rerunning them on this head.
  • Changeset entry: a docs patch for core describing the modal-sheet-on-iOS landing and the data-autofocus instruction. Verified against the doc text; the changeset check accepts it.
  • File .changeset/bottomsheet-doc-webkit-initial-focus.md: clear.
  • File packages/core/src/BottomSheet/BottomSheet.doc.mjs: clear, consistent with the release note.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as draft November 20, 2026 02:53
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 72653a5

@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 20, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI is still running on this head, and its required checks have to pass before merge.

The doc and the release note name only the case the description measured, a modal sheet in Safari on iOS landing on its panel, and the public API is unchanged.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules since the last review: changed rules (0).
  • Claim: before this change the docs named only Chromium (the panel) and Firefox (the first focusable control) for where focus lands on open. Verified against the base doc text, whose only other Safari mention is the keyboard accommodation.
  • Claim: in Safari on iOS a modal sheet with no data-autofocus field lands on its panel. Verified as stated in the description's iOS simulator run, and consistent with the sheet's open-focus code, which keeps the native landing inside a modal sheet and focuses its panel only when focus is outside it.
  • Claim: the docs now name that landing and say to mark a field data-autofocus (a TextInput with hasAutoFocus) to open on it in every browser. Verified in BottomSheet.doc.mjs:178; the rule matches the component's accessibility contract, its cross-browser autofocus test, and TextInput, which marks the field when hasAutoFocus is set.
  • Claim: docs only, with no behavior, prop or record change, and the doc ships with the package. Verified: two files, no API change in any published package, no record touched, and the package publishes src.
  • Claim: desktop Safari and a non-modal Safari sheet are not claimed, and the non-modal unit test does not contradict the sentence. Verified: the doc and the release note name only the modal sheet on iOS, and the test models a lone non-modal sheet taking no focus.
  • Claim: none of the listed overlapping pull requests touches the open-focus sentence. Verified live: none changes it; four do not change the doc file, three change only the height prop description, and one has merged with a theming-target change only.
  • Claim: the changeset, knowledge and sync checks pass, Prettier is clean and the doc module loads. Verified by rerunning them on this head.
  • Changeset entry: a docs patch for core describing the modal-sheet-on-iOS landing and the data-autofocus instruction. Verified against the doc text; the changeset check accepts it.
  • File .changeset/bottomsheet-doc-webkit-initial-focus.md: clear.
  • File packages/core/src/BottomSheet/BottomSheet.doc.mjs: clear, consistent with the release note.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 20, 2026 04:22
@cixzhang
cixzhang merged commit 6df984a into main Nov 20, 2026
151 checks passed
@github-actions
github-actions Bot deleted the lane2/bottomsheet-doc-initial-focus branch November 20, 2026 06:06

This branch was successfully deployed

1 active deployment
Preview — 72653a55 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant