Only consider text input focus as active
This resolves comment on #116 Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
parent
84d30bbd7b
commit
4ebdd9ffa6
1 changed files with 7 additions and 4 deletions
|
@ -140,10 +140,13 @@ class DOM {
|
||||||
* @returns Whether there is currently an active input
|
* @returns Whether there is currently an active input
|
||||||
*/
|
*/
|
||||||
static hasActiveInput() {
|
static hasActiveInput() {
|
||||||
return (
|
const active = document.activeElement;
|
||||||
document.activeElement &&
|
const tag = active.tagName.toLowerCase();
|
||||||
this.inputTags.has(document.activeElement.tagName.toLowerCase())
|
|
||||||
);
|
const checkTag = this.inputTags.has(tag);
|
||||||
|
if (!checkTag) return false;
|
||||||
|
|
||||||
|
return tag !== "input" || active.type === "text";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue