Skip to content

fix(picker): migrated picker to FieldLabelMixin and accessible implementation of select-only combobox pattern#6090

Open
nikkimk wants to merge 20 commits intonikkimk/form-field-mixinfrom
nikkimk/SWC-1449-picker-as-combobox
Open

fix(picker): migrated picker to FieldLabelMixin and accessible implementation of select-only combobox pattern#6090
nikkimk wants to merge 20 commits intonikkimk/form-field-mixinfrom
nikkimk/SWC-1449-picker-as-combobox

Conversation

@nikkimk
Copy link
Contributor

@nikkimk nikkimk commented Mar 18, 2026

Description

  • Updated picker:
    • migrated picker to use FieldLabelMixin
    • updated picker to use accessible implementation of select-only combobox pattern
    • updated picker to apply labels and placeholders correctly, including cross browser support for icons-only implementation
    • updated label warning
    • added deprecation warning for using <sp-field-label> in picker
    • added deprecation warning for using label as a placeholder in picker
  • Updated documentation:
    • ensured labels and placeholders accurately described picker content in order to model accessible usage
    • updated examples to use slotted field-label
    • added deprecation notice for using <sp-field-label> in picker
    • updated examples to use placeholder
    • added deprecation notice for using label as a placeholder in picker
  • Updated stories:
    • ensured labels and placeholders accurately described picker content in order to model accessible usage
    • updated examples to use slotted field-label
    • updated examples to use placeholder
    • kept a deprecated example using <sp-field-label> in picker
    • kept a deprecated example for using label as a placeholder in picker
  • Updated tests:
    • updated tests based on the updated labels and placeholders in stories
    • updated tests based on the correct expectations for name and value in a11y tree, including cross browser support for icons-only implementation
    • added tests for deprecation warning for using <sp-field-label> in picker
    • added tests for deprecation warning for using label as a placeholder in picker

Motivation and context

Add placeholder functionality to Picker components to provide better user experience and address consumer misuse of label attributes as placeholders. While placeholders are controversial in accessibility circles, there is still interest in implementing them as evidenced by design team discussions. This feature will introduce proper placeholder support while maintaining backward compatibility and accessibility compliance.

Related issue(s)

  • fixes 1044

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

Ignore the following failing tests:

  • VRTs: There is a separate ticket to fix the CSS regressions on the nikkimk/form-field-mixin branch
  • Two textfield tests. These are out of scope and need to be fixed as part of the final ticket to prepare nikkimk/form-field-mixin branch to be merged
  • Code coverage. Additional deprecation tests will be added as part of another ticket to prepare nikkimk/form-field-mixin branch to be merged

Using the picker documentation and Storybook examples:

  • Verify placeholder text displays correctly in all components
  • Confirm deprecation warnings appear in console
  • Test all slot combinations work as expected
  • Validate accessibility warnings fire appropriately
  • Check backward compatibility with existing implementations
  • Verify documentation examples render correctly
  • Test keyboard navigation and screen reader behavior

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Accessibility testing checklist

Required: Complete each applicable item and document your testing steps (replace the placeholders with your component-specific instructions).

  • Keyboard (required — document steps below) — What to test for: Focus order is logical; Tab reaches the component and all interactive descendants; Enter/Space activate where appropriate; arrow keys work for tabs, menus, sliders, etc.; no focus traps; Escape dismisses when applicable; focus indicator is visible.

    1. Go here
    2. Do this action
    3. Expect this result
  • Screen reader (required — document steps below) — What to test for: Role and name are announced correctly; state changes (e.g. expanded, selected) are announced; labels and relationships are clear; no unnecessary or duplicate announcements.

    1. Go here
    2. Do this action
    3. Expect this result

@nikkimk nikkimk self-assigned this Mar 18, 2026
@changeset-bot
Copy link

changeset-bot bot commented Mar 18, 2026

⚠️ No Changeset found

Latest commit: 3f26616

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nikkimk nikkimk changed the base branch from main to nikkimk/form-field-mixin March 18, 2026 22:20
@github-actions
Copy link
Contributor

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6090

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@nikkimk nikkimk changed the title Nikkimk/swc 1449 picker as combobox fix(picker): migrated picker to formFieldMixin and accessible implmentation of select-only combobox pattern Mar 20, 2026
@nikkimk nikkimk changed the title fix(picker): migrated picker to formFieldMixin and accessible implmentation of select-only combobox pattern fix(picker): migrated picker to FieldLabelMixin and accessible implementation of select-only combobox pattern Mar 20, 2026
@nikkimk nikkimk marked this pull request as ready for review March 20, 2026 15:32
@nikkimk nikkimk requested a review from a team as a code owner March 20, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant