@postermywall/fabricjs-2 6.4.3-pmw-35 → 6.4.3-pmw-36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -428,7 +428,7 @@
428
428
  }
429
429
  const cache = new Cache();
430
430
 
431
- var version = "6.4.3-pmw-35";
431
+ var version = "6.4.3-pmw-36";
432
432
 
433
433
  // use this syntax so babel plugin see this import here
434
434
  const VERSION = version;
@@ -15208,29 +15208,19 @@
15208
15208
  * @param {Event} e Event object fired on mousedown
15209
15209
  */
15210
15210
  _onTouchStart(e) {
15211
- // we will prevent scrolling if allowTouchScrolling is not enabled and
15212
- let shouldPreventScrolling = !this.allowTouchScrolling;
15213
- const currentActiveObject = this._activeObject;
15211
+ //*PMW* Multiple changes in 6.4.3 reverted from this function to fix contextual menu opening on mobile on touch hold. Investigate and add those back
15212
+ e.preventDefault();
15214
15213
  if (this.mainTouchId === undefined) {
15215
15214
  this.mainTouchId = this.getPointerId(e);
15216
15215
  }
15217
15216
  this.__onMouseDown(e);
15218
- // after executing fabric logic for mouse down let's see
15219
- // if we didn't change target or if we are drawing
15220
- // we want to prevent scrolling anyway
15221
- if (this.isDrawingMode || currentActiveObject && this._target === currentActiveObject) {
15222
- shouldPreventScrolling = true;
15223
- }
15224
- // prevent default, will block scrolling from start
15225
- shouldPreventScrolling && e.preventDefault();
15226
15217
  this._resetTransformEventData();
15227
15218
  const canvasElement = this.upperCanvasEl,
15228
15219
  eventTypePrefix = this._getEventPrefix();
15229
15220
  const doc = getDocumentFromElement(canvasElement);
15230
15221
  addListener(doc, 'touchend', this._onTouchEnd, addEventOptions);
15231
15222
  // *PMW* modified code. calling onTouchMove instead of _onMouseMove to handle drift deviance
15232
- // if we scroll don't register the touch move event
15233
- shouldPreventScrolling && addListener(doc, 'touchmove', this._onTouchMove, addEventOptions);
15223
+ addListener(doc, 'touchmove', this._onTouchMove, addEventOptions);
15234
15224
  // Unbind mousedown to prevent double triggers from touch devices
15235
15225
  removeListener(canvasElement, "".concat(eventTypePrefix, "down"), this._onMouseDown);
15236
15226
  //*PMW* added line