mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix: Shift+L command to work when not in subBlock
This commit is contained in:
@@ -203,6 +203,17 @@ function WorkflowContent() {
|
||||
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.shiftKey && event.key === 'L' && !event.ctrlKey && !event.metaKey) {
|
||||
// Don't trigger if user is typing in an input, textarea, or contenteditable element
|
||||
const activeElement = document.activeElement
|
||||
const isEditableElement =
|
||||
activeElement instanceof HTMLInputElement ||
|
||||
activeElement instanceof HTMLTextAreaElement ||
|
||||
activeElement?.hasAttribute('contenteditable')
|
||||
|
||||
if (isEditableElement) {
|
||||
return // Allow normal typing behavior
|
||||
}
|
||||
|
||||
event.preventDefault()
|
||||
|
||||
if (cleanup) cleanup()
|
||||
|
||||
Reference in New Issue
Block a user