-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"x" buttons have same id in HTML DOM #315
Comments
Yeah, this is a bug. In general, I think the id creation logic across all individual components will probably suffer from the same defect. A safer idea is to prefix with the root id itself. A PR would be welcome! |
Yeah, I'd love to contribute to your awesome lib :> |
Currently, having multiple component instances on same page renders same remove-button, tag ids. Fixes #315
@Nogias9x this is not a bug. If you check in your sandbox, you're assigning custom I removed The same goes for |
Yes you are right @mrchief . But I think the |
When you say it should be “xyz”, you’re unconsciously transitioning into business domain. To avoid being sandboxed into such decisions, the component lets you decide and shape that piece of information. E.g , you could assign the id to be that “xyz” that you need and the component will reflect that. Another person could then use “abc” to be the id and the same component can serve both. My PR is again a generic solution as we support the use case of having multiple instances and it makes sense semantically to have unique ids in the dom. If you’re using id field to store some data, then you don’t need to do so as you can very well pass any arbitrary prop to node and it’ll bubble it back on change events. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
Describe the bug
"x" buttons have same id in HTML DOM.
The problem happens when every node has
id
property, when nodes have .id, "x" buttons stop using DropdownTreeSelect.props.id.To Reproduce
Expected behavior
The buttons' ids should be different between different DropdownTreeSelects (like ${DropdownTreeSelect.props.id}_${node.id}_button).
The text was updated successfully, but these errors were encountered: