diff --git a/packages/client/src/stores/sidePanel.js b/packages/client/src/stores/sidePanel.js index 327fcfae82..3b3b9f5f4d 100644 --- a/packages/client/src/stores/sidePanel.js +++ b/packages/client/src/stores/sidePanel.js @@ -11,18 +11,25 @@ export const createSidePanelStore = () => { open: $store.contentId != null, } }) + let timeout const open = id => { + clearTimeout(timeout) store.update(state => { state.contentId = id return state }) } + + // Delay closing by 50ms to avoid toggling visibility when cycling though + // records const close = () => { - store.update(state => { - state.contentId = null - return state - }) + timeout = setTimeout(() => { + store.update(state => { + state.contentId = null + return state + }) + }, 50) } return {