github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/web/src/shortcut.ts (about)

     1  // if the user is typing in one of these elements, those key-presses shouldn't trigger shortcuts
     2  const ignoredTags = ["input", "textarea"]
     3  
     4  export function isTargetEditable(e: KeyboardEvent): boolean {
     5    // NB: this disables *all* custom shortcuts while in an editable field, including, e.g. ctrl+bksp.
     6    // We could return false if e.KeyCtrl, but then ctrl+v could trigger a 'v' shortcut, which is bad.
     7    // We can worry about those issues if/when they come up.
     8    return (
     9      e.target instanceof Element &&
    10      ignoredTags.includes(e.target.tagName.toLowerCase())
    11    )
    12  }