This object is a container for all workarounds introduced for different environments.
Remarks
When ES modules are used, it can be imported like this:
import { Workarounds } from 'yfiles';
Workarounds.cr320635 = true;
In an environment without ES2015, workarounds can alternatively be activated like before:
yfiles.workaroundCR320635 = true;
or using this container type:
yfiles.Workarounds.cr320635 = true;
Type Details
- yfiles module
- core
- yfiles-umd modules
- All modules
- Legacy UMD name
- yfiles.lang.Workarounds
See Also
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.
Avoids setting SVGElement.transform.baseVal
(obsolete).
Remarks
Symptoms: In Chrome 31-34, a memory leak when using SVG styles in large graphs.
In Firefox 57-60, poor SVG rendering performance.
In WebKit on iOS11, rendering issues especially during zooming.
Original cause: Accessing SVGElement.transform.baseVal
results in severe memory leak.
Workaround: Avoid setting SVGElement.transform.baseVal
.
Workarounds.cr320635 = true;
More information: Chromium issue, Firefox issue, WebKit issue,
See Also
Prevents artificial mousedown
events in Chrome (obsolete).
Remarks
Symptoms: In Chrome 24-42, unexpected behaviors when using mouse button in conjunction with the context menu key.
Workaround: Prevent artificial mousedown
events in Chrome by calling preventDefault()
.
Workarounds.cr433873 = true;
More information: Chromium issue
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 = true;
More information: Chromium issue
See Also
Re-applies the SVG transform matrix once the GraphComponent's <svg>
element is the DOM (obsolete).
Remarks
Symptoms: In Chrome 57, the graph rendering seems to be out of sync with the actual graph item's locations.
Original cause: Chrome does not apply the SVG transform matrix to the GraphComponent's <svg>
element.
Workaround: Re-apply the SVG transform matrix once the GraphComponent's <svg>
element is the DOM.
Workarounds.cr701075 = true;
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
.
Changes attribute names with only upper case characters in string template styles to lower case attribute names.
Remarks
Symptoms: In Edge Legacy, template bindings do not work.
Original cause: Edge's DOMParser.parseFromString
method converts known SVG attributes to all upper case.
Workaround: Change attribute names with only upper case characters in string template styles to lower case attribute names.
Workarounds.edge2057021 = true;
More information: Edge Legacy issue #2057021
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
Refers to the same workaround as ie2337112.
Remarks
Fix broken href
attributes in DOM elements after they have been reinserted, reappended, or replaced.
Remarks
Symptoms: In Internet Explorer, resize handles are missing sometimes or other <use>
elements are not there anymore.
Original cause: SVG <use>
elements disappear. Seems to only happen in Internet Explorer 11 on Windows 10.
Workaround: Fix broken href
attributes in DOM elements after they have been reinserted, reappended, or replaced.
Workarounds.ie2337112 = true;
More information: Internet Explorer issue #2337112
See Also
GWT: Array.isArray causes JavaScript error in Internet Explorer with GWT.
Remarks
Array.isArray
.Workarounds.ie7766782 = true;
See Also
Replaces each non-newline whitespace in label text with '\u00A0
'.
Remarks
Symptoms: In Internet Explorer, white space characters are incorrectly rendered in SVG labels.
Original cause: Internet Explorer does not implement xml:space="preserve"
.
Workaround: Replaces each non-newline whitespace in label text with '\u00A0
'.
Workarounds.ie964525 = true;
More information: Internet Explorer issue #964525
See Also
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
.
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.
Ignores bogus mouse events during and shortly after touch input.
Remarks
Symptoms: In WebKit on iOS 13-14, MoveViewportInputMode gets stuck and panning is no longer possible.
Original cause: Two finger pinch zooming fires bogus mouse events when releasing both fingers at the same time.
Workaround: Ignore these bogus mouse events shortly after the last touchend
event. The time interval in which these events shall be ignored can be set via this workaround flag. Setting it to <= 0
will disable the workaround. A recommended value for enabling this is 100
.
Workarounds.wk203237 = 100;
More information: WebKit issue