-
Notifications
You must be signed in to change notification settings - Fork 2.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
ComboBox invokes onBlur handler unexpectedly when the user clicks the scroll bar of the dropdown menu #6392
Comments
Have you checked to see if this is still the behavior in our current release? If so, we can try to work out a fix and backport it to 5.x. |
@micahgodbolt, Sorry, it was my mistake previously. We are actually using version 6.61.2. I updated the bug report above too. Thanks! |
I'm able to repro this in isolation, here's a Codepen: https://codepen.io/kevintcoughlin/pen/gdJdZj?editors=1010 And here's a Codepen with a similar Tagging as a bug given the above repros. |
@KevinTCoughlin @stanleyymsft Found a fix for when clicking on Scrollbar not to call the onBlur handler but I noticed that it's called also when clicking the arrow to open the ComboBox. Is this something needs to be fixed too, cause it follows the same logic (technically the user's focus is still on the ComboBox as a whole) as the author of the issue states. |
🎉This issue was addressed in #6475, which has now been successfully released as Handy Links: |
Thank you! |
Reopening as there is still some weird |
@Vitalius1 Are you still working on this one? |
@mikewheaton not as of now. Do you think Shield could pick this one up? |
Ok, I've looked at this for a bit and I think I know what's going on. The Additionally, whenever a user simply hovers over a callout element, focus is set on Unfortunately I'm not sure the best way to approach fixing this. I have some questions like:
I'm hoping @jspurlin can give his thoughts... |
Not sure why an onBlur is firing on hover, the autofill should already be focused... In general the autofill needs to continue to have focus when hovering over elements so that the user can continue to type in the input. When the user hovers we keep track of which item is hovered so that the user (if they just hover over an items) can press ENTER and it will select the hovered item. Having onBlur at at full comboBox level where it can handle all the onBlur events sounds good. It looks like the current |
Just to clarify, when you click on the scroll bar to scroll items in the The current Thanks for the input! |
Ah, I missed the scrollbar aspect of this issue. Yeah, focus should always stay in the input ( |
I don't think there's a way to keep focus on |
Nope, but in my mind I think that the |
this might be something to look into during the work in #6030 @ecraig12345 |
@stanleyymsft is this important to resolve? what is the effect of this on SharePoint? |
Dropdown works because 'onBlur' is faked. We control 'focus' of the Dropdown with state, and we only fire onBlur if the dropdown was already closed by the event. Combobox onBlur is normal input focus, and clicking outside of the Combobox causes the input to lose focus. i.e. i'm not sure if there is a way to keep onBlur from firing when the input in fact loses focus. We can always return focus to the input, but not without an onBlur already being called. |
…1584) #### Pull request checklist - [ ] Addresses an existing issue: Fixes #6392 - [ ] Include a change request file using `$ yarn change` #### Description of changes Clicks outside of the input were causing the input to lose focus and fire 'onblur'. With this change clicks to headers, dividers and scrollbars will have no effect, but clicks to menu items work properly. #### Focus areas to test (optional)
🎉This issue was addressed in #11584, which has now been successfully released as Handy links: |
Bug Report
For a ComboBox that is configured with "allowFreeForm" being true, if the user clicks on the scroll bar of the dropdown menu in order to scroll to an option to select, it invokes onBlur handler unexpectedly (technically the user's focus is still on the ComboBox as a whole). In comparison, Fabric Dropdown component doesn't have this issue.
Priorities and help requested:
Are you willing to submit a PR to fix? No
Requested priority: High
Products/sites affected: SPO
Describe the issue:
Add a ComboBox that is configured with "allowFreeForm" to be true and large number of options so that a scroll bar is shown in the dropdown menu. The user clicks on the arrow to open the dropdown menu. Then the user clicks on the scroll bar in the dropdown and try to drag it down or up.
Actual behavior:
Actual: onBlur handler is invoked unexpectedly.
Expected behavior:
Expected: onBlur handler is not invoked because technically the interaction is still on the ComboBox. (Drowdown control doesn't invoke onBlur in this situation)
The text was updated successfully, but these errors were encountered: