Skip to content

feat(ui5-tokenizer): announce token deletion - #14010

Open
aleksandar-terziev wants to merge 1 commit into
mainfrom
announce-token-deletion
Open

feat(ui5-tokenizer): announce token deletion#14010
aleksandar-terziev wants to merge 1 commit into
mainfrom
announce-token-deletion

Conversation

@aleksandar-terziev

Copy link
Copy Markdown
Contributor

BGSOFUIRILA-4445

  • Added a live-region announcement ("1 token deleted" / "{0} tokens deleted") on every deletion path:
    • X-icon click
    • Backspace/ Delete
    • cut
    • N-more popover delete
    • mobile dialog confirm
    • Clear All

@sap-ui5-webcomponents-release

Copy link
Copy Markdown

Comment thread packages/main/src/Tokenizer.ts Outdated
this._handleCurrentItemAfterDeletion(nextToken);

this._tokenDeleting = true;
this._announceTokenDeletion(1);

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.

You can try to move the delete announcement inside _handleCurrentItemAfterDeletion (probably pass an argument of the number of deleted tokens) because at the moment the focus goes to the next token, its info is announced immediately regardless the timeout, and after that "1 token deleted is announced" which is confusing because of the new token information

I would also leave it without a value in case of 1 token, because the hardcoded number looks strange

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried moving the announcement before the focus logic in _handleCurrentItemAfterDeletion, however screen readers prioritize the focus-change speech over the aria-live announcement. We already discussed this with design side and we agreed to leave it to the screen readers to decide what should be announced first.
For the second issue, the hardcoded number has been refactored.

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.

2 participants