This commit is contained in:
nik
2025-10-03 22:27:28 +03:00
parent 829fad0e17
commit 871cf7e792
16520 changed files with 2967597 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
/**
* Mark all elements on the page as inert, except for the ones that are allowed.
*
* We move up the tree from the allowed elements, and mark all their siblings as
* inert. If any of the children happens to be a parent of one of the elements,
* then that child will not be marked as inert.
*
* E.g.:
*
* ```html
* <body> <!-- Stop at body -->
* <header></header> <!-- Inert, sibling of parent -->
* <main> <!-- Not inert, parent of allowed element -->
* <div>Sidebar</div> <!-- Inert, sibling of parent -->
* <div> <!-- Not inert, parent of allowed element -->
* <listbox> <!-- Not inert, parent of allowed element -->
* <button></button> <!-- Not inert, allowed element -->
* <options></options> <!-- Not inert, allowed element -->
* </listbox>
* </div>
* </main>
* <footer></footer> <!-- Inert, sibling of parent -->
* </body>
* ```
*/
export declare function useInertOthers(enabled: boolean, { allowed, disallowed, }?: {
allowed?: () => (HTMLElement | null)[];
disallowed?: () => (HTMLElement | null)[];
}): void;