We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eefd17d commit fcfdd9eCopy full SHA for fcfdd9e
core/src/utils/forms/form-controller.ts
@@ -22,7 +22,10 @@ export const createLegacyFormController = (el: HTMLLegacyFormControlElement): Le
22
* in the light DOM.
23
*/
24
const hasLabelProp = (controlEl as any).label !== undefined || hasLabelSlot(controlEl);
25
- const hasAriaLabelAttribute = controlEl.hasAttribute('aria-label') || controlEl.hasAttribute('aria-labelledby');
+ const hasAriaLabelAttribute =
26
+ controlEl.hasAttribute('aria-label') ||
27
+ // Shadow DOM form controls cannot use aria-labelledby
28
+ (controlEl.hasAttribute('aria-labelledby') && controlEl.shadowRoot === null);
29
30
/**
31
* Developers can manually opt-out of the modern form markup
0 commit comments