mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-13 08:46:19 -04:00
allow focusinput focus node in shadow-root
It seem that document.contains is to check whether the node is removed, but not to consider about the shadow root. The isConnected property mean whether the node is connect to a document or a shadow root that connected to the root document. It is enough to check whether the document is removed.
This commit is contained in:
parent
eb1141b8c8
commit
0cda170f4d
|
|
@ -2520,7 +2520,7 @@ export function focusinput(nth: number | string) {
|
|||
|
||||
// either a number (not special) or we failed to find a special input when
|
||||
// asked and falling back is acceptable
|
||||
if ((!inputToFocus || !document.contains(inputToFocus)) && fallbackToNumeric) {
|
||||
if ((!inputToFocus || !inputToFocus.isConnected) && fallbackToNumeric) {
|
||||
const index = isNaN(nth as number) ? 0 : (nth as number)
|
||||
inputToFocus = DOM.getNthElement(INPUTTAGS_selectors, index, [DOM.isSubstantial])
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue