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.
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.
numberCONTEXTMENU_DEFAULT_OPEN_OFFSET_Xopen_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.
numberCONTEXTMENU_DEFAULT_OPEN_OFFSET_Ybypass_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.
booleantruebypass_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.
numberCONTEXTMENU_DEFAULT_BYPASS_WINDOWbypass_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.
numberCONTEXTMENU_DEFAULT_BYPASS_MOVE_TOLERANCEscoped?
If true, wraps children with a div and listens to events on it instead of the window.
booleanfalselink_entry?
Snippet for rendering link entries.
Set to null to disable automatic link detection.
Defaults to link_entry_default which renders ContextmenuLinkEntry.
Snippet<[any]>link_entry_defaultsnippet parameters
arg0 anytext_entry?
Snippet for rendering copy text entries.
Set to null to disable automatic copy text detection.
Defaults to text_entry_default which renders ContextmenuTextEntry.
Snippet<[any]>text_entry_defaultsnippet parameters
arg0 anyseparator_entry?
Snippet for rendering separator entries.
Set to null to disable automatic separator rendering.
Defaults to separator_entry_default which renders ContextmenuSeparator.
Snippet<[any]>separator_entry_defaultsnippet parameters
arg0 anychildren
The content the root listens over for contextmenu gestures.
Snippet<[]>longpress_move_tolerance?
The number of pixels the pointer can be moved without canceling longpress.
numberCONTEXTMENU_DEFAULT_LONGPRESS_MOVE_TOLERANCElongpress_duration?
The number of milliseconds after a touch starts before opening the Fuz contextmenu.
numberCONTEXTMENU_DEFAULT_LONGPRESS_DURATION