@sequent-org/moodboard 1.2.44 → 1.2.45
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/package.json +1 -1
- package/src/tools/ToolManager.js +16 -1
package/package.json
CHANGED
package/src/tools/ToolManager.js
CHANGED
|
@@ -176,7 +176,17 @@ export class ToolManager {
|
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
this.container.addEventListener('dblclick', (e) => this.handleDoubleClick(e));
|
|
179
|
-
|
|
179
|
+
// wheel должен быть non-passive, чтобы preventDefault работал корректно
|
|
180
|
+
this.container.addEventListener('wheel', (e) => this.handleMouseWheel(e), { passive: false });
|
|
181
|
+
// Блокируем системный зум браузера (Ctrl + колесо) над рабочей областью
|
|
182
|
+
this._onWindowWheel = (e) => {
|
|
183
|
+
try {
|
|
184
|
+
if (e && e.ctrlKey && this.isMouseOverContainer) {
|
|
185
|
+
e.preventDefault();
|
|
186
|
+
}
|
|
187
|
+
} catch (_) {}
|
|
188
|
+
};
|
|
189
|
+
window.addEventListener('wheel', this._onWindowWheel, { passive: false });
|
|
180
190
|
|
|
181
191
|
// События клавиатуры (на document)
|
|
182
192
|
document.addEventListener('keydown', (e) => this.handleKeyDown(e));
|
|
@@ -599,5 +609,10 @@ export class ToolManager {
|
|
|
599
609
|
|
|
600
610
|
document.removeEventListener('keydown', this.handleKeyDown);
|
|
601
611
|
document.removeEventListener('keyup', this.handleKeyUp);
|
|
612
|
+
// Снимаем глобальный блокировщик Ctrl+колесо
|
|
613
|
+
if (this._onWindowWheel) {
|
|
614
|
+
try { window.removeEventListener('wheel', this._onWindowWheel); } catch (_) {}
|
|
615
|
+
this._onWindowWheel = null;
|
|
616
|
+
}
|
|
602
617
|
}
|
|
603
618
|
}
|