From e1737436419e7de61170abacafa7508074591c12 Mon Sep 17 00:00:00 2001 From: Alejandro Parcet Gonzalez Date: Wed, 13 Nov 2024 14:47:59 +0100 Subject: [PATCH] fix: clicking in a selected key deselects it in layout editor Signed-off-by: Alejandro Parcet Gonzalez --- src/renderer/views/LayoutEditor.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/renderer/views/LayoutEditor.tsx b/src/renderer/views/LayoutEditor.tsx index b5b635cb..12bf1c31 100644 --- a/src/renderer/views/LayoutEditor.tsx +++ b/src/renderer/views/LayoutEditor.tsx @@ -885,6 +885,11 @@ const LayoutEditor = (props: LayoutEditorProps) => { const keyIndex = parseInt(currentTarget.getAttribute("data-key-index"), 10); const ledIndex = parseInt(currentTarget.getAttribute("data-led-index"), 10); + if (keyIndex === currentKeyIndex) { + setCurrentKeyIndex(-1); + return; + } + setCurrentLayer(layer); if (colorMap.length > 0 && layer >= 0 && layer < colorMap.length) { setCurrentKeyIndex(keyIndex);