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

Clicking in text while adding dynamic tags clears out text #5491

Closed
4 tasks done
KevVerF opened this issue Apr 29, 2019 · 8 comments · Fixed by #5580
Closed
4 tasks done

Clicking in text while adding dynamic tags clears out text #5491

KevVerF opened this issue Apr 29, 2019 · 8 comments · Fixed by #5580

Comments

@KevVerF
Copy link

KevVerF commented Apr 29, 2019

  • Feature (could be bug too, but not sure)
  • Related issues checked
  • Latest version: (used: 4.0.6)
  • Demo (see below)

Steps to reproduce (using: https://jsbin.com/hukeravete/edit?html,js,output)

  • Start typing next to "DemoText1" to start creation of new dynamic tag
  • Type "Demo Text2" (don't enter nor select the entry)
  • Click between "Demo" & "Text" to attempt to remove the space
  • Field will be cleared rather than remain in edit mode to be able to remove the space

DemoGif

Remarks:

  • This behavior is expected when clicking outside the textarea, not when clicking inside the text.
  • Workaround is to only use the arrow keys to get to the space. (but our users aren't a big fan of that)

Cheers,
Kevin

@flaushi
Copy link

flaushi commented Apr 29, 2019

Confirm! The bug even is worse:
select2bug
I am selecting tags by mouse (fine), and then press "z" keyboard button, which at some stage completely messes up.

@kevin-brown
Copy link
Member

This appears to be occurring because the click within the search box is propagating back to the selection area, which is causing the dropdown to be closed and the search box to be cleared as a result.

@flaushi
Copy link

flaushi commented May 2, 2019

The new version 4.7-rc0 does still have this bug.

@masciugo
Copy link

masciugo commented May 17, 2019

same experience with 4.0.7. Any chance to be fixed in the near future? thanks a lot

@marcolong
Copy link

same issue here with 4.0.7

@blikblum
Copy link
Contributor

This appears to be occurring because the click within the search box is propagating back to the selection area, which is causing the dropdown to be closed and the search box to be cleared as a result.

@kevin-brown

I looked the code and confirm this. Before i do a PR, what should be the correct behavior?

  • Should not close the dropdown at all
  • Should close the dropdown but not clear the text

I think the former is the correct.

Also should the dropdown close on click even if not searching?

@masciugo
Copy link

masciugo commented Jul 1, 2019

@blikblum I would prefer the first one

@blikblum
Copy link
Contributor

blikblum commented Jul 1, 2019

I would prefer the first one

Done at #5551

kevin-brown added a commit that referenced this issue Jul 21, 2019
This fixes a long-standing bug where if you tried to click in the
search box for a multiple select while there was text in it, the
dropdown would close and the text would be cleared. This caused
many unexpected issues, because it meant that you could only use
your keyboard to edit text within the search box.

This will still clear out the search field if you click within the
area of the selection which is not the search field. I'm not sure
if that is also unexpected behaviour, so for now I am going to
maintain it.

Fixes #3517
Fixes #3808
Fixes #5491
Closes #5551
kevin-brown added a commit that referenced this issue Jul 21, 2019
This fixes a long-standing bug where if you tried to click in the
search box for a multiple select while there was text in it, the
dropdown would close and the text would be cleared. This caused
many unexpected issues, because it meant that you could only use
your keyboard to edit text within the search box.

This will still clear out the search field if you click within the
area of the selection which is not the search field. I'm not sure
if that is also unexpected behaviour, so for now I am going to
maintain it.

Fixes #3517
Fixes #3808
Fixes #5491
Closes #5551
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment