Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(): first touch gesture #9684

Merged
merged 3 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [next]

- fix(): first touch gesture [#9684](https://github.com/fabricjs/fabric.js/pull/9684)

## [6.0.0-beta19]

- feat(LayoutManager): Expose objects registration [#9661](https://github.com/fabricjs/fabric.js/pull/9661)
Expand Down
6 changes: 3 additions & 3 deletions src/canvas/Canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Canvas extends SelectableCanvas implements CanvasOptions {
* @type Number
* @private
*/
declare mainTouchId: null | number;
declare mainTouchId?: number;

declare enablePointerEvents: boolean;

Expand Down Expand Up @@ -597,7 +597,7 @@ export class Canvas extends SelectableCanvas implements CanvasOptions {
*/
_onTouchStart(e: TouchEvent) {
e.preventDefault();
if (this.mainTouchId === null) {
if (this.mainTouchId === undefined) {
this.mainTouchId = this.getPointerId(e);
}
this.__onMouseDown(e);
Expand Down Expand Up @@ -661,7 +661,7 @@ export class Canvas extends SelectableCanvas implements CanvasOptions {
}
this.__onMouseUp(e);
this._resetTransformEventData();
this.mainTouchId = null;
delete this.mainTouchId;
const eventTypePrefix = this._getEventPrefix();
const doc = getDocumentFromElement(this.upperCanvasEl);
removeListener(
Expand Down
Loading