Skip to content

Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.

fix(ui): prevent main clipboard flash during Settings retraction

Deepender25cb2149768fdf
diff --git a/src/components/Panel.tsx b/src/components/Panel.tsx
index 3320982..e3b7d9c 100644
--- a/src/components/Panel.tsx
+++ b/src/components/Panel.tsx
@@ -40,8 +40,15 @@ export function Panel() {
useEffect(() => {
if (!open) {
- setSettingsOpen(false)
- setQuery('')
+ // Delay resetting view state until after the retraction spring finishes (~350ms),
+ // so the blade smoothly retracts with the current view without flashing the main clipboard.
+ const timer = window.setTimeout(() => {
+ if (!useStore.getState().open) {
+ setSettingsOpen(false)
+ setQuery('')
+ }
+ }, 400)
+ return () => window.clearTimeout(timer)
}
}, [open, setSettingsOpen, setQuery])
diff --git a/src/hooks/useEdgeHover.ts b/src/hooks/useEdgeHover.ts
index adaded1..d77a8c5 100644
--- a/src/hooks/useEdgeHover.ts
+++ b/src/hooks/useEdgeHover.ts
@@ -142,7 +142,6 @@ export function useEdgeHover(): void {
const closePanelNow = () => {
const s = useStore.getState()
if (s.styleFlyoutOpen) s.setStyleFlyoutOpen(false)
- if (s.settingsOpen) s.setSettingsOpen(false)
s.setOpen(false)
if (interactiveTimer !== undefined) window.clearTimeout(interactiveTimer)
interactiveTimer = window.setTimeout(() => {