-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document.activeElement
is undefined
#179
Comments
This project is not a replacement for JSDOM, it’s a module which goal is performance and SSR where there’s no DOM at all.
if anyone would like to file an extremely simplified PR that in no way affects main goal performance and logic I’ll be happy to consider that, but I won’t personally work on this. |
Just in case someone has the same issue, I was able to make my tests work by using On the test setup:
After doing the call that changes the focus
|
Thank you for the fallback hint, I rather have a collection of these use cases than make LinkeDOM another JSDOM ... all performance gain here are because LinkeDOM is not, and never planned to be, a 1:1 representation of the DOM. JSDOM goal is to help testing on DOM-less environments W3C/WHATWG standards and due that goal is slow (tons of added logic behind) ... as much as JSDOM has been wrongly used to SSR, I don't want LinkeDOM to be wrongly used as W3C specs test environment, as I don't care about replacing the best library out there to do so. If developers have issues with JSDOM slowness, imagine the whole industry use that tool to move forward anyway ... so please consider just simplifying your tests, or don't look for "as standard as JSDOM is" alternatives, 'cause I think there are none, and that's OK here. |
Hello, I'm trying to use linkedom in a project to do unit tests, but I'm having issues with
document.activeElement
Example:
With jsdom
activeElement
will be the input element, but with linkedomactiveElement
is undefinedThe text was updated successfully, but these errors were encountered: