mdgriffith / style-elements

Create styles that don't mysteriously break!
http://package.elm-lang.org/packages/mdgriffith/style-elements/latest
BSD 3-Clause "New" or "Revised" License
445 stars 49 forks source link

select/dropDown problems: autoclose on first click, ghost click #107

Closed Augustin82 closed 6 years ago

Augustin82 commented 6 years ago

The big picture of what I'm trying to do

Use a select with a dropdow menu and several options.

What I did

The following Ellie: https://ellie-app.com/cVxGzYRWBa1/6

What I Expected To Happen

I expected it to behave similarly to a regular select: open when I click, close when I select, open when I click again, etc.

What Actually Happened

There are two problems happening: 1) when I first click on the dropdown, it rapidly opens/closes. It's only the second click that allows me to pick an option 2) after selecting an option, the dropdown remains "focused". If at that moment, without doing anything else, I click once in another window, and then click again somewhere in the HTML section of the Ellie, the dropdown will open/close rapidly again.

Versions

alvivi commented 6 years ago

I'm having the same problem, but only with a MacBook and using the trackpad. If I use a single "soft" tap, it works. But if I click on the trackpad, the drop menu hides instantly.

Maybe a good solution is avoid closing the menu when the user clicks on the selected element, so the second click does nothing.

kuon commented 6 years ago

I just hit this issue using firefox 57 under windows 10. It makes the menu unusable so far.

pro100filipp commented 6 years ago

Submitted a pull request, @mdgriffith could you please merge it? I think it's rather annoying bug but don't want to pollute http://package.elm-lang.org with hard fork 😃