Fix multiple class components to not regenerate IDs on rerender#5201
Merged
cee-chen merged 5 commits intoelastic:masterfrom Sep 21, 2021
Merged
Fix multiple class components to not regenerate IDs on rerender#5201cee-chen merged 5 commits intoelastic:masterfrom
cee-chen merged 5 commits intoelastic:masterfrom
Conversation
+ add consistent suffix regardless of custom ID
1 task
cee-chen
commented
Sep 20, 2021
| let icon; | ||
| let iconButton; | ||
| const buttonId = buttonProps?.id ?? htmlIdGenerator()(); | ||
| const buttonId = buttonProps?.id ?? this.generatedId; |
| 'To exit the list of choices, press Escape.'; | ||
|
|
||
| removeOptionMessageId = htmlIdGenerator()(); | ||
| removeOptionMessageId = rootId('removeOptionMessage'); |
Contributor
Author
| if (id) { | ||
| promptId = `${id}-filePicker__prompt`; | ||
| } | ||
| const promptId = `${id || this.generatedId}-filePicker__prompt`; |
| focusTrapScreenReaderText = ( | ||
| <EuiScreenReaderOnly> | ||
| <p id={descriptionId}> | ||
| <p id={this.descriptionId}> |
Contributor
Author
There was a problem hiding this comment.
Before (description ID rerenders between popover show/hide toggles):
This one is super tough to see because the ID rerender happens in the short split second before the popover unrenders itself completely from the DOM, but you can from the ID Ctrl+F that the ID is changing between each popover render/rerender (as opposed to the fix below, where the ID remains static between show/hide states).
After (ID remains static between show/hide):
In the "after", I can save the popover description ID and ctrl+F for it again after the popover has been re-shown to find the same ID.
| ) | ||
| ); | ||
| const sideNavContentId = htmlIdGenerator('euiSideNavContent')(); | ||
| const sideNavContentId = this.generateId('content'); |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5201/ |
thompsongl
approved these changes
Sep 21, 2021
Contributor
thompsongl
left a comment
There was a problem hiding this comment.
Thanks again, @constancecchen!
Contributor
Author
|
Thanks for the speedy reviews @thompsongl! |
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.










Summary
Parent PR: #5195
titleIdwas being used and I couldn't find an example of it in our docsChecklist
QA screencaps in comments below
Single changelog entry will be made in #5195