Skip to content

Commit 215e1e9

Browse files
Adam GoughAdam Gough
authored andcommitted
fix: Shift+L command to work when not in subBlock
1 parent 2c86679 commit 215e1e9

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

apps/sim/app/w/[id]/workflow.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,17 @@ function WorkflowContent() {
203203

204204
const handleKeyDown = (event: KeyboardEvent) => {
205205
if (event.shiftKey && event.key === 'L' && !event.ctrlKey && !event.metaKey) {
206+
// Don't trigger if user is typing in an input, textarea, or contenteditable element
207+
const activeElement = document.activeElement
208+
const isEditableElement =
209+
activeElement instanceof HTMLInputElement ||
210+
activeElement instanceof HTMLTextAreaElement ||
211+
activeElement?.hasAttribute('contenteditable')
212+
213+
if (isEditableElement) {
214+
return // Allow normal typing behavior
215+
}
216+
206217
event.preventDefault()
207218

208219
if (cleanup) cleanup()

0 commit comments

Comments
 (0)