C

Workarounds

This object is a container for all workarounds introduced for different environments.
Inheritance Hierarchy

Remarks

It can be imported like this:
import { Workarounds } from '@yfiles/yfiles';

Workarounds.Ff1729465 = true;

See Also

Developer's Guide

Members

No filters for this type

Constants

Specifies whether repeated key events for modifier keys that are held down should be considered.

If set to true, the input modes perform hit tests upon repeated key events for modifier keys that are held down.

The default value is falsy, as a result, such repeated key events are ignored.

static
Makes sure that no setTimeout(fn,0) calls are "lost" by flushing Dispatcher actions on mouse move (enabled by default).

Symptoms: Starting with Chrome 47, unresponsive GraphComponent during mouse drag, screen updates at ~1 FPS while moving the mouse.

Original cause: setInterval and setTimeout stop during input if timer callbacks are expensive.

Workaround: Make sure that no setTimeout(fn,0) calls are "lost" by flushing Dispatcher actions on mouse move.

This workaround is enabled by default and can be disabled by setting a value < 0. A value > 0 sets the maximum tolerated delay between last dispatcher invoke call and manual flush, e.g. 26 (flush uses requestAnimationFrame).

Workarounds.cr570845 = 24;

More information: Chromium issue

static

See Also

Developer's Guide
Specifies whether WebGL2 rendering mode should use asynchronous, non-blocking, parallel shader compilation if available.

If this is disabled, shader compilation becomes a synchronous, blocking operation, that will take a significant amount of time unless the compiled shaders are already cached by the browser.

The default value is false.

static
Specifies whether the browser's popover API should be omitted when displaying tooltip and context menus.
Prevents calling preventDefault on touch events by early exiting maybePreventPointerDefault.

This property is enabled by default in Firefox to support multitouch gestures.

Symptoms: Configuring multi-touch gestures like two-finger panning does not work properly in Firefox.

Original cause: Calling preventDefault on the primary pointer prevents Firefox emitting secondary events.

Workaround: Do not call preventDefault on touch events in Firefox.

This workaround is enabled by default in Firefox.

Workarounds.ff1729465 = true;

More information: Firefox issue

static
Corrects the button state of mouse events if the CTRL modifer is pressed and the values of the MouseEvent.button and MouseEvent.buttons properties don't match.

This property is enabled by default in Firefox on macOS to support snapping overwrite with CTRL modifier.

Symptoms: In Firefox on macOS, CTRL cannot be used to overwrite snapping behavior.

Original cause: Firefox on macOS reports a bogus button event state for left clicks with CTRL modifier.

Workarounds.ff1837973 = true;

More information: Firefox issue

static
Specifies whether the default yFiles stylesheet should be loaded automatically.

If enabled and no yfiles.css was loaded explicitly, the stylesheet is inserted into the head element of the document or into the Web Component's DocumentFragment.

When disabled, it is required to load the yfiles.css stylesheet explicitly.

The default value is true.

static
Optionally provides values to control how mouse wheels behave and are distinguished from trackpad pinches and pans.
You can fine-tune some of these settings to adjust for browser, mouse driver, and hardware inconsistencies.
  • resetTime the time in milliseconds that can pass between native wheel events, before a the type of the event will be re-evaluated.
  • mouseWheelThreshold is the value used to discriminate mouse wheel movements from trackpad gestures. Wheel deltas larger than this will be considered mouse wheel events. Set this property to 0 to disable trackpad panning. Mouse wheel events will then always be considered zoom events, even for mouse wheels or mouse drivers that report very small wheel deltas. You can then still use modifiers to pan the canvas with the mouse wheel.
  • mouseWheelMax the maximum value a mouse wheel event should ever have (absolute). This value will clamp the wheel delta value after the correction factor was applied.
  • mouseWheelFactor the correction factor that will be applied to mouse wheel events before passing them on. This will happen before the clamping.
  • trackpadPanMax the maximum value a trackpad panning gesture should ever have (absolute). This value will clamp the wheel delta value after the correction factor was applied.
  • trackpadPanFactor the correction factor that will be applied to trackpad pans before passing them on. This will happen before the clamping.
  • trackpadPinchMax the maximum value a mouse wheel event should ever have (absolute). This value will clamp the wheel delta value after the correction factor was applied.
  • trackpadPinchFactor the correction factor that will be applied to trackpad pans before passing them on. This will happen before the clamping.
static
Specifies whether the shaders used for WebGL2 selection styles should be compiled before they are actually rendered.
The default value is false.
static
Specifies the maximum duration in milliseconds of the leave animation of a tooltip.

After this duration, a tooltip is eventually removed from the DOM after the leave animation was triggered.

By default, the tooltip element is automatically removed from the DOM after its CSS transition/animation ended. However, the "animation end" event can fail under rare circumstances such that the element must be removed explicitly.

The leave transition should not take longer than this duration.

The default value is 5000 (5 seconds).

static
Specifies whether preventDefault() should be called on touchstart events in case PointerEvents are available on the device.

Some mobile devices that support PointerEvents also fire TouchEvents additionally. This can result in unexpected behavior if the default action of the touch event is not prevented.

For example on iOS 13+, the next selectable text on the page is selected by a touch long press if the default action of touchstart is not prevented.

The default value is true for iOS devices.

static
Specifies the duration in milliseconds that WebGL2 label rendering is allowed to take in each frame.

The default value is 90 milliseconds.

Labels that are not rendered within the given duration are delayed to the next frame to keep the browser responsive even when loading thousands of labels.

If set to 0, staggered loading of labels is completely disabled and all labels are rendered at once, blocking the browser until completion.

static