Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [Unreleased]
#### 🐛 Fixed
- Fix `AnnotationSupport` not unsubscribing from `AnnotationTopic` at unmount which causes tow annotations to be created from `SelectionActionAnnotate` in React development mode.
- Fix undo/redo history not working after panning or pinch-zoom gesture on touch devices.

## [0.31.1] - 2025-11-18
#### 🐛 Fixed
Expand Down
30 changes: 16 additions & 14 deletions src/diagram/paperArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -647,23 +647,25 @@ export class PaperArea extends React.Component<PaperAreaProps, State> implements
document.removeEventListener('pointermove', this.onPointerMove);
document.removeEventListener('pointerup', this.onPointerUp);
document.removeEventListener('pointercancel', this.onPointerCancel);
}

if (e && movingState && !movingState.pinchOrigin) {
const {pointerMoved, target, batch, restoreGeometry} = movingState;
this.source.trigger('pointerUp', {
source: this,
sourceEvent: e,
target,
panning: Boolean(movingState.panningOrigin),
triggerAsClick: !pointerMoved,
});
const {pointerMoved, target, batch, restoreGeometry, pinchOrigin} = movingState;
if (e && !pinchOrigin) {
this.source.trigger('pointerUp', {
source: this,
sourceEvent: e,
target,
panning: Boolean(movingState.panningOrigin),
triggerAsClick: !pointerMoved,
});

const restore = restoreGeometry.filterOutUnchanged();
if (restore.hasChanges()) {
batch.history.registerToUndo(restore);
const restore = restoreGeometry.filterOutUnchanged();
if (restore.hasChanges()) {
batch.history.registerToUndo(restore);
}
batch.store();
} else {
batch.discard();
}
batch.store();
}
};

Expand Down