How to prevent context menu from showing in Chrome's device view

typeoneerror

I've got an <input> that onFocus is selecting the text:

onFocusHandler = (event) => {
  event.currentTarget.select()
}

This works fine in Chrome, but when I view it in "Device" mode, each time the text is selected, the context menu shows up with "Look up <selected text>" at the top. Is there a different way to select the text that won't do this?

typeoneerror

Based on Сергей Петрашко's comment, I gave this a shot:

<Input
  type="number"
  value={value || ''}
  onChange={this.onChangeHandler}
  onFocus={this.onFocusHandler}
  onContextMenu={e => e.preventDefault()}
  onUnfocusHandler={this.onUnfocusHandler}
/>

This prevents the context menu from showing. I also found that just using onClick to select the text does not show the context menu either (without preventing the onContextMenu event).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to prevent context menu in an iframe?

How to prevent menu showing before it's fully loaded?

Chrome extension, custom context menu item not showing

How to bind List View Item's Context Menu to ICommand

Prevent showing system context menu on right click on Form title bar

How to prevent default context menu on QGraphicsTextItem?

How to create a new file from Finder's context menu?

Firefox is not showing the "View Page Info" option in the context menu

How do I prevent UIScrollView from zooming in a ton when activating an iOS 13 context menu?

how to disable chrome application context menu

Is there any way to remove "Inspect Element" from Chrome's right click context menu?

How to add context menu to the "outline" view in VsCode?

How to prevent child View from parents's onPress

How do I prevent Chrome from disposing(?) of my webgl drawing context after switching tabs?

How can I add to the context menu in Chrome's Omnibox(Address bar)?

Toolbar context menu showing inside toolbarbutton's xul panel

Prevent context menu from opening on a right click over element

ADF: How to avoid hiding table's Column from view Menu

Prevent KDE and Gnome from showing eachothers icons in the menu

"Mount" for .ISO's disappeared from context menu

Embedded youtube video on touch device showing right click context menu automatically

How to prevent FreeBSD from disconnecting a drive device?

How can I prevent "Media Device" from showing up on a network, while keeping my computer on the network? (Windows 10 Home)

How to prevent the copy of thrust's device_vector to device

How to convert flv file(s) to mp3 from PCManFM's (Open with) context menu?

Developer menu not showing on iOS device

my sub-menu is not showing in safari but it's does in chrome and firefox

WPF DataGridComboBoxColumn not showing the context menu?

How to prevent the UISearchController from showing the navigation bar?