mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-06 17:57:42 +02:00
UBERF-8600 Fix toolbar disappearing on click (#7223)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
@@ -97,7 +97,7 @@
|
||||
|
||||
let selecting = false
|
||||
|
||||
function handleMouseDown (): void {
|
||||
function handleMouseDown (event: MouseEvent): void {
|
||||
function handleMouseMove (): void {
|
||||
if (editor !== undefined && !editor.state.selection.empty) {
|
||||
selecting = true
|
||||
@@ -112,9 +112,11 @@
|
||||
document.removeEventListener('mouseup', handleMouseUp)
|
||||
}
|
||||
|
||||
if (editor !== undefined) {
|
||||
document.addEventListener('mousemove', handleMouseMove)
|
||||
document.addEventListener('mouseup', handleMouseUp)
|
||||
if (editor !== undefined && visible && visibleActions.length > 0) {
|
||||
if (event.target !== null && toolbar !== null && !toolbar.contains(event.target as Node)) {
|
||||
document.addEventListener('mousemove', handleMouseMove)
|
||||
document.addEventListener('mouseup', handleMouseUp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user