diff --git a/src/ui.js b/src/ui.js index 9c23d64..610d691 100644 --- a/src/ui.js +++ b/src/ui.js @@ -148,6 +148,9 @@ export class Dialog { const self = this; this.root.addEventListener('mousedown', (e) => { if (self.mode !== 'free') return; + // Only initiate drag from the header bar. This prevents stealing focus + // from inputs, selects, and buttons inside the dialog body. + if (!e.target.closest('.tat-header')) return; if (e.target.classList.contains('tat-close')) return; const rect = self.root.getBoundingClientRect(); self.dragState = { dx: e.clientX - rect.left, dy: e.clientY - rect.top };