This object is a container for all workarounds introduced for different environments.
Remarks
import { Workarounds } from '@yfiles/yfiles';
Workarounds.Ff1729465 = true;Type Details
- yFiles module
- core
demos/utils/Workarounds.js file already. If you use yFiles for HTML in production without the demo classes, you should enable these workarounds in your own code if your application is affected by the corresponding issues.Default Properties
Specifies whether repeated key events for modifier keys that are held down should be considered.
Remarks
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.
Makes sure that no setTimeout(fn,0) calls are "lost" by flushing Dispatcher actions on mouse move (enabled by default).
Remarks
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
Specifies whether WebGL2 rendering mode should use asynchronous, non-blocking, parallel shader compilation if available.
Remarks
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.
Prevents calling preventDefault on touch events by early exiting maybePreventPointerDefault.
Remarks
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
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.
Remarks
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
Specifies whether the default yFiles stylesheet should be loaded automatically.
Remarks
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.
mouseWheelParameters
: Partial<{ mouseWheelThreshold: number; mouseWheelMax: number; mouseWheelFactor: number; trackpadPinchMax: number; trackpadPinchFactor: number; trackpadPanMax: number; trackpadPanFactor: number; resetTime: number; }> | undefined?Optionally provides values to control how mouse wheels behave and are distinguished from trackpad pinches and pans.
Remarks
resetTimethe time in milliseconds that can pass between native wheel events, before a the type of the event will be re-evaluated.mouseWheelThresholdis 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 to0to 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.mouseWheelMaxthe maximum value a mouse wheel event should ever have (absolute). This value will clamp the wheel delta value after the correction factor was applied.mouseWheelFactorthe correction factor that will be applied to mouse wheel events before passing them on. This will happen before the clamping.trackpadPanMaxthe maximum value a trackpad panning gesture should ever have (absolute). This value will clamp the wheel delta value after the correction factor was applied.trackpadPanFactorthe correction factor that will be applied to trackpad pans before passing them on. This will happen before the clamping.trackpadPinchMaxthe maximum value a mouse wheel event should ever have (absolute). This value will clamp the wheel delta value after the correction factor was applied.trackpadPinchFactorthe correction factor that will be applied to trackpad pans before passing them on. This will happen before the clamping.
Specifies the maximum duration in milliseconds of the leave animation of a tooltip.
Remarks
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).
Specifies whether preventDefault() should be called on touchstart events in case PointerEvents are available on the device.
Remarks
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.
Specifies the duration in milliseconds that WebGL2 label rendering is allowed to take in each frame.
Remarks
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.