question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<label><select></label> doesn't open when clicked

See original GitHub issue

I have something like this:

<label>
   <select id='x'>...</select>
</label>
new Choices(document.getElementById('x'))

But I can’t click it. I can press spacebar on it just fine, though.

It seems like it opens the dropdown, then closes it immediately:

            } else if (this.passedElement.type === 'select-one' && target !== this.input && !this.dropdown.contains(target)) {
              this.hideDropdown(true);
            }

this is indeed !== this.input. and this.dropdown indeed doesn’t have target:

image

What happens here is that two click events happen.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DanielRufcommented, Nov 27, 2017

I see the same issue. When it is wrapped in the label it does not work.

Chrome 62 stable on macOS 10.12

0reactions
stale[bot]commented, Oct 27, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<label><select></label> doesn't open when clicked #57 - GitHub
It immediately closes because the focus is no longer on the actual input, it is on the label (as far as I know)....
Read more >
Program Won't Open When You Click On It in Windows 10? 7 ...
How to Fix When Windows 10 Programs Won't Open ; First, open the Microsoft Store. ; This will open a list of your...
Read more >
jQuery on click event firing multiple times - Stack Overflow
This seems to work fine but when I use it in my code I get the click event fired twice. It fires as...
Read more >
Setting preferences in After Effects - Adobe Support
Open Layer Panel when Double-clicking with Paint, Roto Brush, ... layer with that label color and choose Edit > Label > Select Label...
Read more >
I can not open start button by clicking on it nor can I get to my
Please help, My start button doesnt work when i click on it, I cant even get to my settings button!!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found