-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Autocomplete] Fix selecting undefined on updated options #18611
[Autocomplete] Fix selecting undefined on updated options #18611
Conversation
Details of bundle changes.Comparing: a5f4a4d...acc2f1c
|
@jellyedwards Thanks for the tests! Could you run prettier to fix the build fail? I will have a closer look this evening, I would like to test a bit more extensively the changes. |
@oliviertassinari @eps1lon Thoughts on running a git hook to do the formatting? |
@merceyz I personally hate git hooks when they are slow. At the same time, this prettier issue comes from time to time (I hit this problem myself, I haven't set up "prettier on save" in my code editor). |
87e31a8
to
acc2f1c
Compare
const textbox = getByRole('textbox'); | ||
expect(textbox).to.have.focus; | ||
expect(textbox).not.to.have.attribute('aria-activedescendant'); | ||
expect(document.activeElement).to.have.focus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL - When viewing a document, an element with focus is always the active element in the document, but an active element does not necessarily have focus. For example, an active element within a popup window that is not the foreground doesn't have focus.
https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by this method. I didn't understand the underlying concept 🙃
Hi,
I've implemented changes suggested by @oliviertassinari to fix #18590 and #18456 and put in a test for each too. Both tests fail without the suggested changes, and pass with them.
It's my first PR for MUI so hopefully I haven't missed/messed anything!
Cheers,
John
Closes #18590
Closes #18456