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.

[Listbox] Wait for mousemove before allowing mouseup to trigger an option select

See original GitHub issue

❓Question

Is there specific reason for Listbox component to select am item on museUp? I’m trying to implement a design where selected ListboxOption is displayed on top of the ListboxButton, similar how https://material-ui.com/components/selects/ does it.

Or like chrome does it with native select tag.

Screen Shot 2020-04-01 at 7 07 52 PM

I’m passing a custom position prop to ListboxPopover component that calculates the position - and that seems to work, but when clicking on the ListboxButton happens it immediately closes and does not stay open. Was looking at the Listbox code and it seemed like item selection get’s triggered on mouseUp


Is there a way to do what I’m trying to do? Or is this not possible…?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chaancecommented, Apr 22, 2020

Addressed in 0.10.1

1reaction
marexandrecommented, Apr 13, 2020

@chancestrickland just tried out the master branch and code from listbox/examples/position-over-active.example.tsx - and it worked great out the box and managed to get the design to look like we wanted 😄 Thank you so much for all the changes!

Using querySelector could potentially be a bit fragile if we update something internally that interferes with mount/paint timing.

Could not agree more - as there was no way to get access to the selected option before your updates that was the easier way to prototype on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent WPF ListBox from selecting item under mouse when ...
If a WPF ListBox gets a MouseMove event while the mouse button is held down, it will change the listbox's selection. That is,...
Read more >
ListBox.MouseMove event (Access) - Microsoft Learn
To cause a MouseMove event for a form to occur, move the mouse pointer over a blank area, record selector, or scroll bar...
Read more >
ListBox Class Reference - JUCE
Sets the rows that should be selected, based on an explicit set of ranges. More... bool, isRowSelected (int rowNumber) const. Checks whether a...
Read more >
Mouse Events and Cursors - Springer Link
MouseMove. Raised when the mouse cursor moves over a control. MouseUp. Raised when the mouse button is released. By default, this event always...
Read more >
Implementing a smoothly animated ListBox - CodeProject
MultiSelectEnabled : when true , the selection model allows several ... This means that if a mouse move event occurs before the previous...
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