-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(cdk/testing): simulate focusin/focusout events #23795
base: main
Are you sure you want to change the base?
fix(cdk/testing): simulate focusin/focusout events #23795
Conversation
Caretaker note: this change previously caused a few failures in g3. |
5cddadf
to
09a46af
Compare
09a46af
to
d5f5022
Compare
Ran presubmit recently and got 39 failures. I briefly looked at the test failures and many of them are because the autocomplete element cannot be found. Needs more investigation, but I'm noticing tests that are manually invoking the |
d5f5022
to
2f649ef
Compare
ac78558
to
c0cbdad
Compare
Fixes that our fake fallback focus events weren't dispatching `focusin` and `focusout` events as well. Fixes angular#23757.
c0cbdad
to
5fefbd8
Compare
@crisbeto it looks like a bunch of tests call I wonder could we still fire the focus/blur and just skip the focusin/focusout depending on the current state? I started going through all of the tests to change them to focus and then blur, but the more tests I change the more I feel that this isn't really a desirable change, I think its just going to confuse people about why their blur logic isn't working |
When I first submitted the PR, it didn't have all the extra checks around |
I figured it was something like that. That's why I'm asking can we always fire the |
Looking at my CL from when I tried to land this (cl/433124526), that's what I tried doing as well but there were still a handful of failures. I can change it here if you want to give it a shot. |
This is a resubmit of #23768.
Fixes that our fake fallback focus events weren't dispatching
focusin
andfocusout
events as well.Fixes #23757.
Caretaking Note: spent a couple of hours looking into this, but it turned out to be trickier than expected. The extra events trigger a "changed after checked" error in some apps. Tried to simulate browser events even closer by only emitting the events when elements have focus, but that broke even more apps.