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.

Input keeps hidden after selecting option with openMenuOnClick=false

See original GitHub issue

I set openMenuOnClick=false.

  1. Select a option
  2. Click outside the component
  3. Click back inside the component

The cursor dos not show up. The options are filtered when typing but the actual input value is not displayed either.

  1. Repeat 2. and 3.

The cursor is shown. The input value is displayed as well.

I found that the isHidden property in the Input field remains true and the Input element is not displayed after selecting the option and clicking out of the component (step 1. to 3.). It is reset to false after step 4 (see console output in the sandbox example).

Please refer to this Codesandbox.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
sullyslegacycommented, Feb 10, 2020

I agree the opacity isn’t reset this is just a workaround

0reactions
haejinjocommented, Sep 23, 2022

Fixed my issue (might not be the root cause of yours, but hopefully it saves somebody time)

My selected option text wasn’t showing up after fiddling with the closeMenuOnSelect prop as well.

I debugged for hours and tried everything on this thread – to no avail. It turns out inputValue was fine and I was making a silly mistake by omitting the label field in the object I pass into the value prop.

For example my code that hid the selected option value:

<DialogSelect
  ...otherProps
  inputValue={'option title'}
  value= { { value: 'option title' } }
/>

and my code that successfully renders the selected option value:

<DialogSelect
  ...otherProps
  inputValue={'option title'}
  value= { { label: 'option title', value: 'option title' } } // god damn it
/>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid dropdown menu close on click inside - Stack Overflow
First by handling the click on the link to open/close the dropdown like this : ... This event is fired immediately when the...
Read more >
Menus - Android Developers
On Android 3.0 and higher, the options menu is considered to always be open when menu items are presented in the app bar....
Read more >
Introduction to browser events - The Modern JavaScript Tutorial
An event is a signal that something has happened. All DOM nodes generate such signals (but events are not limited to DOM).
Read more >
Popovers - Bootstrap
Documentation and examples for adding Bootstrap popovers, like those found in iOS, to any element on your site. Overview. Things to know when...
Read more >
<input type="hidden"> - HTML: HyperText Markup Language
As mentioned above, hidden inputs can be used anywhere that you want to include data the user can't see or edit along with...
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