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.

Selection via mouse click does not work when menu is inside a portal

See original GitHub issue
  • downshift version: 1.3.0
  • node version:
  • npm (or yarn) version:

What you did:

Trying to implement simple select component using Downshift. The requirement for my select is that menu is inside a portal. I’m using react-portal npm package that leverages React’s native createPortal() API.

What happened:

After I’ve put menu inside portal, selection via mouse stopped working. Menu is being closed as always, but selection does not happen.

Reproduction repository:

Here’s a sandbox: https://codesandbox.io/s/w7p91ol19k You can try selecting one of menu items. The onChange is not happening, the state is not changed. Try removing Portal element. Without portal everything works as expected.

I believe, there is something to do with mousedown and blur event handlers. I have found that there are native event listeners for mousedown and mouseup events. They are preventing the selection of item due to calling reset prior to that.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
kentcdoddscommented, Jun 14, 2018

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

3reactions
kentcdoddscommented, Dec 19, 2017

Thanks for the report! We could probably add a feature for the upcoming getMenuProps function (see the pull requests) which would apply a ref so we can check that as well as the root ref… Unless someone else has another idea.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot click on menu items (mouse does not work, therefore ...
Cannot click on menu items (mouse does not work, therefore stuck at the 'Select database' screen) when using Citrix to deploy Controller, ...
Read more >
Can't select script trigger or conditional formatting
I have a very difficult time right-clicking a field in a portal row to display a drop-down menu that shows script trigger and...
Read more >
Microstation mouse selection is not working for anything??
I go to "button assignments" and try to click "remap buttons" and nothing pops up, as if my mouse click does nothing.
Read more >
Right Click not working - SAP Community
Hi,. I am using IE 8.0 for portal development. Context menu, which is generated by using the right click, isn't working. Do I...
Read more >
How to Fix Mouse Right-Click If It's Not Working?
Problems with the right mouse button can be caused by incompatible drivers, hardware issues, or corrupted system files. In this article, we show ......
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