[Bug Report] v-slider generates duplicate element id's
See original GitHub issueVersions and Environment
Vuetify: 1.5.7 Vue: 2.6.10 Browsers: Chrome 73.0.3683.86 OS: Mac OS 10.14.3
Steps to reproduce
- Use a Vuetify v-slider component with a custom id
- See the generated HTML (both the container div and the input elements have the same id)
Expected Behavior
Each element should have a unique id, if both container and input elements need an id there could be a container-id
similar to the suggested solution in #2777. Otherwise the id could be auto-generated with container
appended or only the input should have the id. (probably best to stay consistent with other form controls)
<v-slider
id="slider-input-id"
container-id="slider-container-id"
v-model="slider"
></v-slider>
Actual Behavior
<v-slider
id="slider-id"
v-model="slider"
></v-slider>
Also see the HTML output on this demo
Reproduction Link
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Sync Report error: Records not processed due to duplicate IDs
Sync Report error: Records not processed due to duplicate IDs ... Clever requires a unique ID for every record we process, and each...
Read more >Is it possible to debug for duplicate Ids? - Stack Overflow
It's most likely a <h:column> or <rich:column> . Quick way to find out the exact component is findComponent() : UIComponent component = context....
Read more >How to resolve Duplicated Id error "Duplicate Persistent ... - PTC
How to resolve Duplicated Id error "Duplicate Persistent ID for element named/Duplicate ID is generated from source. This ID already belongs to ...
Read more >How to Fix in R: Error: Duplicate identifiers for rows - Statology
This tutorial explains how to fix the following error in R: Error: Duplicate identifiers for rows.
Read more >EMC: Reporting shows duplicate queues and ... - Avaya Support
If the wrong one is selected, or is part of a list of selections, it will cause the report to generate a "No...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
id’s are generated here: https://github.com/vuetifyjs/vuetify/blob/30632ab56f6215f66cdecd06f35b5fee9ab7faef/packages/vuetify/src/components/VInput/VInput.ts#L81 so it seems that Vue’s _uid is not unique enough for this component.
maybe change from
computedId (): string { return this.id || `input-${this._uid}` },
tocomputedId (): string { return this.id || `input-${this._uid}+${Math.ceil(Math.random()*1000)}` },
would be enough?i’m also experiencing this error message, is there a work around or fix planned?