Skip to content

Prevent mouse click on input text from clearing text#1159

Open
zachary1006 wants to merge 1 commit intocibernox:masterfrom
zachary1006:prevent-input-clear-on-mouse-click
Open

Prevent mouse click on input text from clearing text#1159
zachary1006 wants to merge 1 commit intocibernox:masterfrom
zachary1006:prevent-input-clear-on-mouse-click

Conversation

@zachary1006
Copy link

As noted in #646, clicking inside a power-select-multiple input field after typing text clears the text. This proposed fix stops the propagation of the mousedown event if there is text in the input field.

To reproduce:
This issue can be seen on the Ember Power Select multiple-selection page (https://ember-power-select.com/docs/multiple-selection). To reproduce, type some text into the input field (do not press "Enter"). Then click your mouse in the input field, as though you were adjusting the cursor on a Word document. The text vanishes and the dropdown is closed.
screen shot 2018-09-20 at 8 28 03 am
Typing in the input
screen shot 2018-09-20 at 8 28 10 am
Text disappears on click

Expected behavior:
The cursor can be repositioned by clicking the mouse.
screen shot 2018-09-20 at 8 31 36 am
Cursor can be repositioned by clicking in the input

@dwickern
Copy link
Contributor

dwickern commented Mar 4, 2019

@cibernox Could you take a look at this PR?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants