mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
UBERF-8600 Fix toolbar disappearing on click (#7223)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
1095493fa7
commit
fe68f8f4c6
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user