Skip to content

fix(picker-column): focus options in setFocus - #31797

Open
adityajai119 wants to merge 1 commit into
ionic-team:mainfrom
adityajai119:fix-picker-column-set-focus
Open

adityajai119 wants to merge 1 commit into
ionic-team:mainfrom
adityajai119:fix-picker-column-set-focus

Conversation

@adityajai119

Copy link
Copy Markdown
Contributor

Issue number: resolves #30634


What is the current behavior?

Since 8.7.4 (#30563), calling setFocus() on ion-picker-column does nothing, and scrolling a picker column no longer updates aria-valuetext on the slider element while dragging.

#30563 removed the separate .assistive-focusable element and moved role="slider", tabindex, aria-valuetext, and keyboard handling onto scrollEl (.picker-opts), but setFocus() and the scroll aria-valuetext callback still read this.assistiveFocusable, which is never assigned.

What is the new behavior?

  • setFocus() focuses this.scrollEl so calling column.setFocus() focuses the column and enters keyboard input mode on numericInput columns again.
  • The scroll callback updates aria-valuetext on scrollEl, and the unused assistiveFocusable field is removed.
  • Added spec tests in picker-column.spec.tsx for setFocus() and the live aria-valuetext scroll update, and restored setFocus() in the picker keyboard-entry e2e tests.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Tests run locally on Windows:

  • npm run test.spec -- --ci: 105 suites, 914 tests pass. Both new picker-column.spec.tsx tests fail on main (Expected number of calls: 1, Received: 0 and Expected: "Second", Received: "First") and pass with this change.
  • npx playwright test src/components/picker/test/keyboard-entry/picker.e2e.ts src/components/picker/test/a11y/picker.e2e.ts src/components/picker-column/test/basic/picker-column.e2e.ts --project="Mobile Chrome": all tests pass. On main, the picker keyboard-entry tests using setFocus() fail (Expected: focused, Received: inactive and event "ionChange" was not received).
  • npm run lint (ESLint, Stylelint, Prettier) and npm run build pass cleanly.

AI-assisted: drafted with an AI coding agent; the tests above were run locally.

ionic-team#30563 removed the separate assistiveFocusable element and moved the
slider role and keyboard handling onto scrollEl (.picker-opts), but left
setFocus() and the scroll aria-valuetext update reading
assistiveFocusable. Point both at scrollEl and remove the unused field
so setFocus() focuses the column and enters keyboard input mode again.

resolves ionic-team#30634
@adityajai119
adityajai119 requested a review from a team as a code owner November 20, 2026 16:22
@adityajai119
adityajai119 requested a review from ShaneK November 20, 2026 16:22
@vercel

vercel Bot commented Nov 20, 2026

Copy link
Copy Markdown

@adityajai119 is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the package: core @ionic/core package label Nov 20, 2026
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Nov 20, 2026 5:44pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — f0512b13 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

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: picker-column setFocus() does not focus the column

1 participant