USWDS - date-picker: Resolve chrome non-unique empty id warnings.#4200
Closed
seanpclark wants to merge 1 commit into
Closed
USWDS - date-picker: Resolve chrome non-unique empty id warnings.#4200seanpclark wants to merge 1 commit into
seanpclark wants to merge 1 commit into
Conversation
Contributor
|
Thanks for submitting this! We'll take a look as soon as we can. |
mejiaj
reviewed
May 28, 2021
mejiaj
left a comment
Contributor
There was a problem hiding this comment.
Confirming this change removes the empty ID.
But here's some strange thing I noticed. There's an empty name attribute on the newly generated input.

<input
class="usa-input usa-date-picker__external-input"
id="event-date-start"
name=""
type="text"
aria-describedby="event-date-start-label event-date-start-hint"
>This doesn't seem practical because if we click the label it points to the hidden input, not the enhanced one.
That name value gets intentionally deleted on line:862
uswds/src/js/components/date-picker.js
Lines 861 to 862 in 976948a
Also, notice how the internalInputEl gets cloned and then it's type gets set to text. The original is text, so this seems unnecessary.
4 tasks
Contributor
|
Closing in favor of #4218. |
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.
Description
The date picker component sets an id to "".
Chrome gives a warning as it treats multiple empty ids as non-unique.
Additional information
Visit a following page in Chrome withe more than 1 date picker, and see console warnings (ex. https://designsystem.digital.gov/components/date-range-picker/)