Skip to content
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

Suggestions list stuck open after dragging a suggestion outside of the autosuggest #412

Closed
imerkle opened this issue Jul 24, 2017 · 9 comments · Fixed by #566
Closed

Suggestions list stuck open after dragging a suggestion outside of the autosuggest #412

imerkle opened this issue Jul 24, 2017 · 9 comments · Fixed by #566

Comments

@imerkle
Copy link

imerkle commented Jul 24, 2017

Issue from here: mui/material-ui#7526

@moroshko
Copy link
Owner

Having read mui/material-ui#7526, it's not clear to me what the issue is.

Could you please list the steps to reproduce the issue?

cc @oliviertassinari

@oliviertassinari
Copy link

Here is an example, I hope that helps:

juil -24-2017 16-45-12

@moroshko
Copy link
Owner

After you drag the suggestion, the focus is no longer on the input.
What exactly do you expect to happen when pressing Up/Down afterwards?

@oliviertassinari
Copy link

oliviertassinari commented Jul 24, 2017

@moroshko I don't think that the issue is with the keybinding, but rather with an opened suggestion list. Focusing and blurring the input will no longer close the suggestions.

@mrmojica
Copy link

I'm experiencing the same behavior after the click hold and mouse-out, where the suggestions will no longer close. Did anyone figure out a work around?

@moroshko
Copy link
Owner

Yep, it's a bug.

In case anyone would like to contribute a PR, here are the steps to reproduce it:

  1. Visit http://react-autosuggest.js.org
  2. Focus on the Basic example input
  3. Type c
  4. Drag one of the suggestions to the rest of the page

Observed behavior: The input loses focus, causing the suggestions to be stuck in a visible state (clicking outside of the autosuggest doesn't close the suggestions).

Expected behavior: The input keeps focus. Clicking outside of the autosuggest closes the suggestions. See Google's autosuggest as an example.

@moroshko moroshko changed the title Keyboard input dosent works after click hold and mouseout Suggestions list stuck open after dragging a suggestion outside of the autosuggest Jul 28, 2017
@scotta-koorong
Copy link

  1. The Mousedown handler is called and justSelectedSuggestion is set to true
  2. Then the input is blurred by the browser because you've clicked/dragged on another element other than the input box (aria-activedescendant doesn't seem to be doing its job)
  3. Even clicking the input box to try focus and unfocus it doesn't work because justSelectedSuggestion remains true and isn't set back to false except until you click a suggestion.

This code separates the blurring of the input box from the hiding of the container

if (!_this2.justSelectedSuggestion) { _this2.onBlur(); _this2.onSuggestionsClearRequested(); }

I'm still trying to figure out a fix for this, but this is the cause I believe.

@minhsong
Copy link

Have anyone fix this issues? could you share how to fix this issues?

@svante-jonsson
Copy link

svante-jonsson commented Apr 3, 2024

Was this issue resolved? I am still experiencing this issue on version 10.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants