FocusTarget Typing Suggestion
See original GitHub issueversion: "focus-trap-react": "^8.7.1"
I recently needed to use focusTrapOptions.initialFocus
initialFocus?: FocusTarget | false;
I tried using HTMLDivElement
, but I got an error. Looking at global.d.ts, HTMLDivElement
extends HTMLElement
, so the suggestion would be to add a generic type, eg:
export type FocusTarget<T extends HTMLElement> = T | SVGElement | string | { (): T | SVGElement };
so that all elements that are extended from HTMLElement
be accepted.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
xurion/ffxi-focus-target - GitHub
FFXI Focus Target. A Windower 4 addon that allows you to focus a target in a similar fashion to Final Fantasy XIV. It...
Read more >WoW Rookie: Keep your key targets in focus - Engadget
/target focus To quickly make your focus target your current main target, type (or create a macro with the command) /target focus.
Read more >androidx.compose.ui.focus - Android Developers
This modifier allows you to specify properties that are accessible to focusTarget s further down the modifier chain or on child layout nodes....
Read more >Focus Target in SUF - MMO-Champion
I can only guess you don't have the focus bar activated? Type: /Suf Go to: Enabled Units In the general section, ensure 'Focus'...
Read more >How to hide others' debuffs on my target/focus target
yes, i've used that command! and i notice when i type in 0, it unchecks the box, and when i type 1, it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Once the other focus-trap changes are merged, I’ll publish focus-trap and then publish focus-trap-react to update its dependency on focus-trap, and then you’ll have all the right typings.
OK, great! So that’s basically what we have now (just hasn’t been published yet because there are a few changes in flight still that I’m waiting on to be done). See https://github.com/focus-trap/focus-trap/blob/master/index.d.ts#L14