Skip to content
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

Don't add duplicate IDs for anchors without IDs #9

Closed
XhmikosR opened this issue Dec 25, 2014 · 1 comment
Closed

Don't add duplicate IDs for anchors without IDs #9

XhmikosR opened this issue Dec 25, 2014 · 1 comment

Comments

@XhmikosR
Copy link
Contributor

So, for the IDs we generate, we should make sure they are unique. Not sure what the performance penalty will be or how exactly to do it, but it shouldn't be hard, in theory.

@bryanbraun
Copy link
Owner

I think this is a great idea, but you're right... we should keep an eye on performance.

One approach could be to query the DOM for each ID we generate, to make sure nothing is there already. This seems like it could cause a performance hit if we're generating a lot of IDs.

Maybe there's a way to pull all the the IDs in the DOM with one query, check against that list with each new generated ID, and add new generated IDs to the list as we go. Seems like that might be lighter weight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants