Re: [WICG/webcomponents] Allow a click on label associated with custom element to focus the custom element (#891)

Unfortunately this still doesn't work.

A possible workaround:

1. Find the label.
2. Attach handler that focuses your input when found label is clicked.

To find the label:

1. search parent element(s)
```
this.parentElement.tagName === "LABEL"
```
2. if the element has an `id` attribute set, find the label by `for` attribute
```
document.querySelector(`label[for="${id}"]`);
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/891#issuecomment-2127044504
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/891/2127044504@github.com>

Received on Thursday, 23 May 2024 12:59:10 UTC