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.

bindHover almost working

See original GitHub issue

I am facing a problem with the bindHover hook, it all works on enter but when I leave the MenuItem I hovered on, the Menu does not automatically close:

image

I am using the following versions of Material-UI:

Might be related to https://github.com/jcoreio/material-ui-popup-state/issues/9.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jedwards1211commented, Jun 26, 2020

Would it be possible to make a codesandbox to reproduce your issue? Here’s the Material-UI codesandbox template: https://codesandbox.io/s/material-ui-issue-dh2yh?file=/src/Demo.js

In OP’s case it seemed to be caused by the menu items being unintentionally remounted on each render (according to a code sample in a different issue), so that’s one thing to check for.

0reactions
jedwards1211commented, Jun 26, 2020

Oh man, I completely forgot about the workarounds I had created for hover cases… 😂

In this case you need to

import Menu from 'material-ui-popup-state/HoverMenu'

or

import Popover from 'material-ui-popup-state/HoverPopover'

This is because Material-UI Modal has a bad design where it blocks all pointer events from getting through to any other components on the screen (therefore the hovered element never receives a mouse leave event), requiring a messy workaround.

I’ll fix the examples in the README and make this clearer…sorry for the confusion!

Read more comments on GitHub >

github_iconTop Results From Across the Web

bindHover on menu #3 - jcoreio/material-ui-popup-state - GitHub
Note: the fix only works if you pass a popupId prop to PopupState , because it needs popupId to find your submenu component....
Read more >
Why the first event "hover" not working? - Stack Overflow
p.s. The following code is working. Because there are not only one set, I should use loop "for". $("#Map area:eq(0)" ...
Read more >
getcontentanchorel | The AI Search Engine You Control
Created almost 4 years ago. 20. hey there I'm trying to use bindHover with bindMenu but when mouse moves on sub menu list...
Read more >
aurelia/Discuss - Gitter
I've got it somewhat working, but I installed core-js types using tsd install core-js and kept seeing errors pertaining to ArrayLike. @marwijn ...
Read more >
Extension talk:MsUpload - MediaWiki
VisualEditor already has a simple way to upload files. There're no plans to make MsUpload work with the VisualEditor.
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