[select] Reset typeahead on external blur#2618
Conversation
…s from selection (mui#2608)
commit: |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
mj12albert
left a comment
There was a problem hiding this comment.
Works great, thanks for the contribution @antonfrolovsky
| const withinReference = next ? elements.domReference?.contains(next) === true : false; | ||
| const withinFloating = next ? elements.floating?.contains(next) === true : false; |
There was a problem hiding this comment.
These should use shadow DOM contains util
There was a problem hiding this comment.
Okay, I'll check it out as soon as possible
|
The solution here might be simpler given it works when it re-opens: #2608 (comment) Maybe the resetting just needs to happen when useIsoLayoutEffect(() => {
if (open) {
timeout.clear();
matchIndexRef.current = null;
stringRef.current = '';
}
}, [open, timeout]); |
|
@atomiks Used the contains util in blur handling and added the |
|
I found one other issue with |
|
Thanks for your contribution, @antonfrolovsky! |
Fixes #2608
Updated
useTypeaheadto handleonBlurso the typeahead session resets only when focus leaves the reference ↔ floating pair.