use-disabled
Synchronize the state of the disabled prop with the fieldset tag
Inherit the disabled status of a parent tag type fieldset, under certain rules:
  1. 1.
    The label must be on the lightDOM.
  2. 2.
    The component that uses this hook must declare the prop {disabled: Boolean}.

Import

1
import { useDisabled } from "@atomico/hooks/use-disabled";
Copied!

Sintaxis

1
const disabled:boolean = useDisabled(matches?: string = "fieldset");
Copied!
Where:
  1. 1.
    matches: Optional string, allows to change the search of the parent tag fieldset for another tag or selector compatible with Element.matches.

Example

WebComponents.dev
WebComponents.dev
Last modified 2mo ago
Copy link
Edit on GitHub