Skip to content

Commit 098d046

Browse files
committed
fix: prevent erroneous movement during consecutive smooth transitions
1 parent 8ab1132 commit 098d046

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mind-elixir",
3-
"version": "5.3.6",
3+
"version": "5.3.7",
44
"type": "module",
55
"description": "Mind elixir is a free open source mind map core.",
66
"keywords": [

src/interact.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ export const scaleFit = function (this: MindElixirInstance) {
156156
*/
157157
export const move = function (this: MindElixirInstance, dx: number, dy: number, smooth = false) {
158158
const { map, scaleVal, bus } = this
159+
if (smooth && map.style.transition === 'transform 0.3s') {
160+
// Prevent consecutive smooth moves
161+
return
162+
}
159163
const transform = map.style.transform
160164
let { x, y } = getTranslate(transform)
161165
x += dx

0 commit comments

Comments
 (0)