mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-28 08:06:16 +00:00
fix: let a click outside home's composer land before it folds
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8dd46a4d14
commit
e13fb2ebd7
@@ -628,7 +628,17 @@
|
||||
}
|
||||
function onComposerPointerDown(e: PointerEvent) {
|
||||
if (!homeComposer || !composerOpened || composerEl?.contains(e.target as Node)) return
|
||||
if (!isComposerOverlay(e.target)) closeComposer()
|
||||
if (isComposerOverlay(e.target)) return
|
||||
// Folding moves the page up under the pointer: done on the press, the click that follows
|
||||
// lands on whatever slid into place instead of what was pressed. So the press decides, and
|
||||
// the fold waits until that click has been delivered.
|
||||
const done = new AbortController()
|
||||
const fold = () => {
|
||||
done.abort()
|
||||
setTimeout(closeComposer)
|
||||
}
|
||||
window.addEventListener('pointerup', fold, { capture: true, signal: done.signal })
|
||||
window.addEventListener('pointercancel', fold, { capture: true, signal: done.signal })
|
||||
}
|
||||
|
||||
// Home's composer is one block of the page and takes the page's column as it is.
|
||||
|
||||
Reference in New Issue
Block a user