query-selector-shadow-dom icon indicating copy to clipboard operation
query-selector-shadow-dom copied to clipboard

Escape class names

Open jhtvarma opened this issue 3 years ago • 1 comments

When an element has class names starting with number, the Element.matches is failing to identify the right element.

Ex: div.classA.2f683ff1c2173060crd67792e542ss17

Expected: Should identify element with classA and 2f683ff1c2173060crd67792e542ss17 as classes Actual: Element.matches throws Error as it is invalid id

@Georgegriff Let me know your thoughts on this

jhtvarma avatar Sep 16 '22 10:09 jhtvarma

https://stackoverflow.com/questions/21227702/is-there-a-workaround-to-make-css-classes-with-names-that-start-with-numbers-val according to this you need to escape the first digit for it to be a valid query selector

Georgegriff avatar Sep 16 '22 11:09 Georgegriff

Closing, package moving to new owner

Georgegriff avatar Nov 17 '22 18:11 Georgegriff