activeElement is missing from Document
See original GitHub issueElemental2 version : 1.0.0-RC1 The document object provide by DomGloabl does not have the activeElement property as a workaround i extended the HTMLDocument type and added the property and it worked out
@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public class MyDocument extends HTMLDocument {
public Element activeElement;
}
checking this out on MDN it says it is supported by most of modern browsers.
https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/activeElement
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
$(document.activeElement) is not working in Firefox [closed]
Please debug your application using console.log(document.activeElement) to see if it's the element you're expecting. This is almost always the first step in ...
Read more >Document.activeElement - Web APIs | MDN
The activeElement read-only property of the Document interface returns the Element within the DOM that currently has focus.
Read more >How to Determine Which Element Has Focus in JavaScript
Although an element with focus is always the active element in the document, an active element does not necessarily have focus. For example,...
Read more >@solid-primitives/active-element - npm
A reactive document.activeElement. Check which element is currently focused.. Latest version: 2.0.3, last published: 3 days ago.
Read more >builtins.Document.activeElement JavaScript and Node.js code ...
activeElement !== document.body ) { // Not all elements support .blur() - SVGs among them. if( ... `was not found inside element ${new...
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
Suggest changing the title and topic of this - @jDramaix, according to MatrixFrog over at https://github.com/google/closure-compiler/pull/2865, elemental2 should perhaps be pulling in more of the
*_dom.js
files (specifically ie_dom.js), since it appears thatactiveElement
already exists and should not be moved (though it’s type is too specific and must be fixed still).It isn’t entirely clear to me which direction this should go, but at least other closure-compatible projects seem to prefer adding more extern files.
Alternatives that may be worth considering:
w3c
files, nothing browser-specific*_dom.js
etc files to the various.diff
s in elemental2This remains a difficult topic for us non-Googlers to approach, we’re hoping for your guidance here in coordinating between different Google projects (even if non-official).
Thanks