-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
8.0.4 broke element blur in jsDom #482
Comments
RGunning
added a commit
to RGunning/spectator
that referenced
this issue
Sep 13, 2021
3 tasks
RGunning
added a commit
to RGunning/spectator
that referenced
this issue
Sep 13, 2021
duplicate of #477 same fix as there, need to call focus before blur now |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
I'm submitting a...
Current behavior
Calling blur on a element when in a jsDom environment triggers the angular cdkFocusMonitor
Prior to 8.0.4 calling
spectator.blur
on a input element with a cdkFocusMonitor listening to the parent element would trigger the subscribe. Current behaviour is that the subscribe is no longer called.Expected behavior
The blur bubbles in a jsDom environment and trigger the focus monitor subscription.
Minimal reproduction of the problem with instructions
For bug reports please provide the STEPS TO REPRODUCE and if possible a MINIMAL DEMO of the problem via
https://stackblitz.com or similar (you can use this template as a starting point: https://bit.ly/2zme3bj).
What is the motivation / use case for changing the behavior?
8.0.4 breaks my unit tests, so i can't update to latest spectator.
Environment
Bug introduced by https://github.com/ngneat/spectator/pull/473/files if in a jsDom environment
patchElementFocus
no longer does anything when it used to callelement.focus = () => dispatchFakeEvent(element, 'focus'); element.blur = () => dispatchFakeEvent(element, 'blur');
Re-adding
element.blur = () => dispatchFakeEvent(element, 'blur');
is enough to restore old behaviour.The text was updated successfully, but these errors were encountered: