fix: Drawing settings panel UI and interaction bugs (close button, text color palette, keyboard propagation)

This commit is contained in:
DiTus
2026-03-22 18:26:15 +01:00
parent beda3858e9
commit 0f1ea8976c

View File

@ -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 || '';