material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Menu] On Firefox, selection gets removed after a right-click on selected text to open the context menu

Open ravi-thorat opened this issue 3 years ago • 3 comments

Duplicates

  • [X] I have searched the existing issues

Latest version

  • [X] I have tested the latest version

Current behavior 😯

With Firefox [v102.0 (64-bit)] and Material UI's context menu combination, when I select the text and perform a right-click on the selected text, it triggers a context, but it just clears out the text selection. It is reproducible on the Material UI's official site as well.

Expected behavior 🤔

When I select the text and perform a right-click on the selected text, it should open the context menu keeping the user text selection as is.

Steps to reproduce 🕹

Steps:

  1. Open the Firefox browser.
  2. Go to the Material UI's official site that demonstrates context menu implementation.
  3. Select some random text and perform right click on it.

firefox-context-menu

Context 🔦

I am trying to implement a context menu in my project which already has a material UI dependency.

Your environment 🌎

No response

ravi-thorat avatar Jul 25 '22 14:07 ravi-thorat

I believe this behavior is inherent to Firefox - whenever another element is focused, the selection is lost. This isn't specific to Material UI. Proof: https://jsbin.com/jovakuyimu/1/edit?html,js,output

michaldudak avatar Jul 26 '22 11:07 michaldudak

Any workaround for this? Material UI should support Firefox out of the box.

ravi-thorat avatar Aug 04 '22 10:08 ravi-thorat

We do support Firefox. As I stated above, this issue is not specific to Material UI. We can't control Firefox's internal behavior. I'm not aware of any workarounds for this.

michaldudak avatar Aug 09 '22 09:08 michaldudak