Skip to content

Right-click to copy/paste in inputs is prevented by context menu #1

@randomdevpete

Description

@randomdevpete

Scenario:

  1. An input is inside a contextMenu wrapped zone
  2. I select some text in the input and want to right-click to do copy/paste
  3. But instead the custom contextMenu appears so I can't do normal copy/paste

Possible solutions:

  • This could just be left to consumers to handle (by wrapping their inputs in a stopGathering wrapper). But my feeling is you should have to opt-in if you specifically want to override this menu and maybe provide your own editing menu and copy/paste behaviour on right-click (say if you were building a document editor).
  • As an easier to use but still manual version could provide a <NoContextMenu> component which implements stopGathering
  • Alternately, check where the click originated. If in an input, bypass contextMenu. In this case there needs to be a ContextMenuProvider option to change the behaviour. Also it would be good to override the behaviour on an individual component basis; maybe some inputs require a custom context menu, but others we want the native one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions