From 0f1ea8976c98465df9bc420df382933019cbbc32 Mon Sep 17 00:00:00 2001 From: DiTus Date: Sun, 22 Mar 2026 18:26:15 +0100 Subject: [PATCH] fix: Drawing settings panel UI and interaction bugs (close button, text color palette, keyboard propagation) --- js/ui/drawing-tools.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/ui/drawing-tools.js b/js/ui/drawing-tools.js index c37fa47..d15d7c9 100644 --- a/js/ui/drawing-tools.js +++ b/js/ui/drawing-tools.js @@ -1206,6 +1206,7 @@ export class DrawingManager { let startX, startY, initialX, initialY; header.addEventListener('mousedown', (e) => { + if (e.target.closest('button')) return; // Allow clicking the close button isDragging = true; startX = e.clientX; startY = e.clientY; @@ -1329,6 +1330,10 @@ export class DrawingManager { this.applySettings('text', e.target.value); }); + document.getElementById('tlTextInput').addEventListener('keydown', (e) => { + e.stopPropagation(); + }); + document.getElementById('tlAlignVert').addEventListener('change', (e) => { this.applySettings('alignVert', e.target.value); }); @@ -1400,7 +1405,6 @@ export class DrawingManager { if (isLineWithText) { if (textColorBtn && textPicker) { textColorBtn.style.backgroundColor = settings.textColor || settings.color; - textPicker.classList.remove('hidden'); } fontInput.value = settings.fontSize || 14; textInput.value = settings.text || '';