Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

<Tab> ids have extra # in front: id="foo" renders to id="#foo" #45

Closed
DaxChen opened this issue Feb 4, 2018 · 6 comments
Closed

<Tab> ids have extra # in front: id="foo" renders to id="#foo" #45

DaxChen opened this issue Feb 4, 2018 · 6 comments

Comments

@DaxChen
Copy link

DaxChen commented Feb 4, 2018

see this on your demo page, inspect on the panels!

@evanernest
Copy link

evanernest commented Feb 15, 2018

+1

Laravel Dusk won't test these malformed id attributes.

@evanernest
Copy link

Made PR #50 to address this situation. Not really a JS ninja, but I tried to adhere to the contributing guidelines. Please forgive any faux pas.

@aphofstede
Copy link

aphofstede commented Mar 20, 2018

@evanernest Note that those are not malformed in HTML5: https://mathiasbynens.be/notes/html5-id-class
You might be able to escape them in your selectors (e.g. in your tests) with (double) backslash. (document.querySelector('#\\#foo'))
That being said, I would also say it's a bug if it becomes id="#foo" if you pass id="foo". +1

@evanernest
Copy link

evanernest commented Mar 20, 2018

@aphofstede Thanks. That does work. Learn something new every day. I rescind the "malformed" portion of my statement.

But yeah, in my case, the component is generating the id by kebab-casing the name attribute from the <tab>, so it seems like undesired behavior to add the '#'.

@aphofstede
Copy link

@sebastiandedeyne PR good enough to merge? May be a breaking change, since it'll probably break many people's tests and other code that references elements by ID.

@sebastiandedeyne
Copy link
Member

Makes sense to merge imo since it was producing invalid html

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

No branches or pull requests

4 participants