Skip to content

Conversation

thetaPC
Copy link
Contributor

@thetaPC thetaPC commented Oct 10, 2025

Issue number: internal


What is the current behavior?

Currently, when an error text is shown, it may not announce itself to voice assistants. This is because the way error text currently works is by always existing in the DOM, but being hidden when there is no error. When the error state changes, the error text is shown, but as far as the voice assistant can tell it's always been there and nothing has changed.

What is the new behavior?

  • Updated aria attributes
  • Added observer with an observer

We had to do this with a mutation observer and state because it's important in some frameworks, like Angular, that state changes to cause a re-render. This, combined with some minor aria changes, makes it so that when a field is declared invalid, it immediately announces the invalid state instead of waiting for the user to go back to the invalid field.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Preview

Copy link

vercel bot commented Oct 10, 2025

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

Project Deployment Preview Comments Updated (UTC)
ionic-framework Ready Ready Preview Comment Oct 14, 2025 9:56pm

@github-actions github-actions bot added package: core @ionic/core package package: angular @ionic/angular package labels Oct 10, 2025
@thetaPC thetaPC marked this pull request as ready for review October 10, 2025 18:12
@thetaPC thetaPC requested a review from a team as a code owner October 10, 2025 18:12
@thetaPC thetaPC requested review from OS-jacobbell and brandyscarney and removed request for OS-jacobbell October 10, 2025 18:12
Copy link
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

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

Just a couple questions but non-blocking. Great job!

* since promises are high priority.
*/
Promise.resolve().then(() => {
this.hintTextID = this.getHintTextID();
Copy link
Member

Choose a reason for hiding this comment

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

Why do we use a state here instead of calling forceUpdate?

Copy link
Member

Choose a reason for hiding this comment

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

The comment looks like it describes why, though it may have been added after (I appreciate it either way). Maybe @thetaPC found this more reliable than my method of using forceUpdate? My attempt was not perfect, so a more reliable method would be great

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brandyscarney I've updated the comment to explain it a bit better: 641f250

* Checks if the input is in an invalid state based
* on Ionic validation classes.
*/
private checkInvalidState(): boolean {
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this to a shared util file since it's used by multiple components?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@ShaneK ShaneK left a comment

Choose a reason for hiding this comment

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

I've tested and reviewed this and it looks great! I did agree with Brandy's request to move the validation check to a util file since we'll apparently be using it in multiple places, but that's a non-blocking request IMO. Great work!

@thetaPC thetaPC added this pull request to the merge queue Oct 15, 2025
Merged via the queue into main with commit 03303d7 Oct 15, 2025
51 checks passed
@thetaPC thetaPC deleted the FW-6797 branch October 15, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants