fix(web-components): remove tooltip id from target’s aria-describedby attribute when the t…#36241
Open
marchbox wants to merge 2 commits into
Open
fix(web-components): remove tooltip id from target’s aria-describedby attribute when the t…#36241marchbox wants to merge 2 commits into
marchbox wants to merge 2 commits into
Conversation
…ooltip is removed from DOM
📊 Bundle size report✅ No changes found |
|
Pull request demo site: URL |
| @@ -0,0 +1,7 @@ | |||
| { | |||
There was a problem hiding this comment.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-web-components/Badge 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-web-components/Badge. - Dark Mode.normal.chromium.png | 443 | Changed |
vr-tests-web-components/MenuList 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-web-components/MenuList. - RTL.2nd selected.chromium.png | 17 | Changed |
| vr-tests-web-components/MenuList. - RTL.normal.chromium_1.png | 39083 | Changed |
vr-tests-web-components/TextInput 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-web-components/TextInput. - Dark Mode.normal.chromium_1.png | 288 | Changed |
davatron5000
approved these changes
May 26, 2026
Comment on lines
+74
to
+96
| test('should remove the tooltip id from `aria-describedby` attribute when tooltip is removed', async ({ | ||
| fastPage, | ||
| }) => { | ||
| const { element, page } = fastPage; | ||
| const button = page.locator('button'); | ||
|
|
||
| await fastPage.setTemplate(/* html */ ` | ||
| <div style="position: absolute; inset: 200px"> | ||
| <button id="target">Target</button> | ||
| <${tagName} anchor="target">This is a tooltip</${tagName}> | ||
| <${tagName} anchor="target">This is another tooltip</${tagName}> | ||
| </div> | ||
| `); | ||
|
|
||
| const id2 = await element.nth(1).evaluate((node: Tooltip) => node.id); | ||
|
|
||
| await element.nth(0).evaluate(node => { | ||
| node.remove(); | ||
| }); | ||
|
|
||
| await expect(button).toHaveAttribute('aria-describedby', id2); | ||
| }); | ||
|
|
Contributor
There was a problem hiding this comment.
Do we need more tests here to test all possible states?
- assert both id1 and id2 are applied to button aria-describedby?
- assert id2 exists after id1 is removed (in this PR)
- assert id1 does not exist in button aria-describedby?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous Behavior
When a
<fluent-tooltip>is removed from the DOM, its ID remains in thearia-describedbyattribute on the target element.New Behavior
The IDREF is removed from target element’s
aria-describedbyattribute.Related Issue(s)
Fixes #35470