ContextmenuRootForSafariCompatibility.svelte

view source

Declarations
#

ContextmenuRootForSafariCompatibility
#

ContextmenuRootForSafariCompatibility.svelte view source

accepts children

import ContextmenuRootForSafariCompatibility from '@fuzdev/fuz_ui/ContextmenuRootForSafariCompatibility.svelte';

Adds contextmenu-pending class to body during longpress tracking. This applies aggressive user-select/touch-callout blocking via CSS to give iOS the earliest possible signal to not show selection UI.

contextmenu?

The contextmenu state. Each root defaults to its own new instance - pass one to control or observe the menu externally.

optional default new ContextmenuState()

open_offset_x?

The number of pixels to offset from the pointer X position when opened. Useful to ensure the first menu item is immediately under the pointer.

type number
optional default CONTEXTMENU_DEFAULT_OPEN_OFFSET_X

open_offset_y?

The number of pixels to offset from the pointer Y position when opened. Useful to ensure the first menu item is immediately under the pointer.

type number
optional default CONTEXTMENU_DEFAULT_OPEN_OFFSET_Y

bypass_with_tap_then_longpress?

Whether to detect tap-then-longpress to bypass the Fuz contextmenu. This allows access to the system contextmenu by tapping once then rightclicking/long-pressing. Setting to false disables the gesture.

type boolean
optional default true

bypass_window?

The number of milliseconds between taps to detect a gesture that bypasses the Fuz contextmenu. Used only when bypass_with_tap_then_longpress is true. If the duration is too long, it'll detect more false positives and interrupt normal usage, but too short and some people will have difficulty performing the gesture.

type number
optional default CONTEXTMENU_DEFAULT_BYPASS_WINDOW

bypass_move_tolerance?

The number of pixels the pointer can be moved between taps to detect a tap-then-longpress. Used only when bypass_with_tap_then_longpress is true.

type number
optional default CONTEXTMENU_DEFAULT_BYPASS_MOVE_TOLERANCE

scoped?

If true, wraps children with a div and listens to events on it instead of the window.

type boolean
optional default false

link_entry?

Snippet for rendering link entries. Set to null to disable automatic link detection. Defaults to link_entry_default which renders ContextmenuLinkEntry.

type Snippet<[any]>
optional default link_entry_default
snippet parameters
arg0 any

text_entry?

Snippet for rendering copy text entries. Set to null to disable automatic copy text detection. Defaults to text_entry_default which renders ContextmenuTextEntry.

type Snippet<[any]>
optional default text_entry_default
snippet parameters
arg0 any

separator_entry?

Snippet for rendering separator entries. Set to null to disable automatic separator rendering. Defaults to separator_entry_default which renders ContextmenuSeparator.

type Snippet<[any]>
optional default separator_entry_default
snippet parameters
arg0 any

children

The content the root listens over for contextmenu gestures.

type Snippet<[]>

longpress_move_tolerance?

The number of pixels the pointer can be moved without canceling longpress.

type number
optional default CONTEXTMENU_DEFAULT_LONGPRESS_MOVE_TOLERANCE

longpress_duration?

The number of milliseconds after a touch starts before opening the Fuz contextmenu.

type number
optional default CONTEXTMENU_DEFAULT_LONGPRESS_DURATION

Depends on
#