Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(material/chips): adds default placeholder for chips input #30452

Merged
merged 12 commits into from
Mar 17, 2025

Conversation

essjay05
Copy link
Contributor

@essjay05 essjay05 commented Feb 6, 2025

Updates Angular Components Chips input by moving the input outside of the mat-chip-grid to ensure the input is accessible by Voice Control. Additionally updates documentation and examples to recommend using an aria-label on the input to optimize accessibility.

Before screenshot 1st Chip input
Before screenshot 2nd Chip input

After screenshot 1st & 2nd Chip input

Fixes b/380092814

@angular-robot angular-robot bot added area: build & ci Related the build and CI infrastructure of the project area: material/chips labels Feb 6, 2025
@crisbeto crisbeto added the dev-app preview When applied, previews of the dev-app are deployed to Firebase label Feb 6, 2025
Copy link

github-actions bot commented Feb 6, 2025

Deployed dev-app for c4ff6b7 to: https://ng-dev-previews-comp--pr-angular-components-30452-dev-oqnzawn0.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@angular-robot angular-robot bot added the area: docs Related to the documentation label Feb 6, 2025
@essjay05 essjay05 marked this pull request as ready for review February 6, 2025 21:40
@essjay05 essjay05 requested a review from a team as a code owner February 6, 2025 21:40
@essjay05 essjay05 requested review from crisbeto and andrewseguin and removed request for a team February 6, 2025 21:40
@essjay05 essjay05 force-pushed the add-default-placeholder-chips-input branch from 940dd06 to 171b064 Compare February 12, 2025 18:36
@essjay05 essjay05 requested a review from crisbeto February 13, 2025 02:04
@essjay05 essjay05 force-pushed the add-default-placeholder-chips-input branch 2 times, most recently from 9a1017a to 4dcabfd Compare March 10, 2025 15:32
essjay05 added 12 commits March 17, 2025 16:49
Updates Angular Components Chips input so that if no placeholder value
is provided and if no ariaPlaceholder value is provided, that a default
value will be used. This improves accessibility by providing an
aria-placeholder value for VoiceControl to use as a name for the input.

Fixes b/380092814
Updates to fix lint errors.
Ran command to update chips.md.
…grid

Updates previous chips-demo.html so that the input element is not a child
of chip-grid, but rather a sibling. When mat-chip-grid contains the input,
it hides this as an interactive element from mobile Voice Controls making
it inaccessible.

Fixes b/380092814
…ition

Updates documentation on chips.md regarding proper placement of the input
element as a sibiling of  as opposed to being a child. Also
adds an explanation of the new implementation of ariaPlaceholder on mat-chip
input.
…ips input

Updates previous fix to Angular Components chips input for using aria-placeholder
and converts it to ariaLabel instead. For the chips-demo moved the input related
to chip-grid to outside of chip-grid so that Voice Control is able to recognize
input as an interactive element. If inside, the input is hidden from Voice
Control making it not fully accessible.
Updating previous fix to see if ariaLabel will be read even if input is
inside chip-grid.
Updates previous fix by implementing recommended changes by reviewer.
Updates previous change to Chips demo to use aria-label.
Cleans up previous changes and removes unused code.
Updates example which previously used ariaPlaceholder and instead uses
an aria-label.
Ran command to update chips.md api guard.
@essjay05 essjay05 force-pushed the add-default-placeholder-chips-input branch from 4dcabfd to c4ff6b7 Compare March 17, 2025 16:49
@crisbeto crisbeto removed the request for review from andrewseguin March 17, 2025 16:52
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Mar 17, 2025
@crisbeto crisbeto merged commit 09b25a1 into angular:main Mar 17, 2025
22 of 24 checks passed
@crisbeto
Copy link
Member

The changes were merged into the following branches: main, 19.2.x

crisbeto pushed a commit that referenced this pull request Mar 17, 2025
* fix(material/chips): creates default aria-placeholder for chips input

Updates Angular Components Chips input so that if no placeholder value
is provided and if no ariaPlaceholder value is provided, that a default
value will be used. This improves accessibility by providing an
aria-placeholder value for VoiceControl to use as a name for the input.

Fixes b/380092814

* refactor(material/chips): fix lint errors

Updates to fix lint errors.

* build(material/chips): updates build for chips.md

Ran command to update chips.md.

* fix(material/chips): fixes chips input demo moving input out of chip-grid

Updates previous chips-demo.html so that the input element is not a child
of chip-grid, but rather a sibling. When mat-chip-grid contains the input,
it hides this as an interactive element from mobile Voice Controls making
it inaccessible.

Fixes b/380092814

* docs(material/chips): update chips docs based on aria-placeholder addition

Updates documentation on chips.md regarding proper placement of the input
element as a sibiling of  as opposed to being a child. Also
adds an explanation of the new implementation of ariaPlaceholder on mat-chip
input.

* refactor(material/chips): convert ariaPlaceholder to ariaLabel for chips input

Updates previous fix to Angular Components chips input for using aria-placeholder
and converts it to ariaLabel instead. For the chips-demo moved the input related
to chip-grid to outside of chip-grid so that Voice Control is able to recognize
input as an interactive element. If inside, the input is hidden from Voice
Control making it not fully accessible.

* refactor(material/chips): testing ariaLabel with input inside chip-grid

Updating previous fix to see if ariaLabel will be read even if input is
inside chip-grid.

* refactor(material/chips): make recommended changes after review

Updates previous fix by implementing recommended changes by reviewer.

* refactor(material/chips): updates chips demo to use aria-label

Updates previous change to Chips demo to use aria-label.

* refactor(material/chips): removes commented out code

Cleans up previous changes and removes unused code.

* docs(material/chips): updates chips input accesibility recommendation

Updates example which previously used ariaPlaceholder and instead uses
an aria-label.

* build(material/chips): updates build for chips.md

Ran command to update chips.md api guard.

(cherry picked from commit 09b25a1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project area: docs Related to the documentation area: material/chips dev-app preview When applied, previews of the dev-app are deployed to Firebase target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants