ux icon indicating copy to clipboard operation
ux copied to clipboard

[LiveComponents] It seems like data-live-id values must not start with a number

Open manuelkiessling opened this issue 1 year ago • 4 comments

This issue occurs starting with UX LiveComponents v2.14.0, prior versions do not have this issue.

When setting data-live-id on a component to a value that starts with a number, this results in:

Uncaught (in promise) DOMException: Element.querySelector: '[data-live-id=4]' is not a valid selector

which occurs in live_controller.js line 2353:

findChildComponentElement(id, element) {
    return element.querySelector(`[data-live-id=${id}]`);
}

Just a hunch, but I assume that using data-live-id="${id}" instead might solve this.

manuelkiessling avatar Feb 14 '24 17:02 manuelkiessling

You're right.

Now, as data-live-id will be deprecated for id, and the recommendation for id is yet still "ascii-starting-with-a-letter" (ref and description of the potential problems) i'm not sure we can fix just the 2.14 for that :|

smnandre avatar Feb 15 '24 20:02 smnandre