Skip to content

VscodeTree silently kills onKeyDown events for 'Escape' key #628

Description

@colmmurphyxyz

Referencing the code snippets from vscode-tree.ts

const listenedKeys: ListenedKey[] = [
  ' ',
  'ArrowDown',
  'ArrowUp',
  'ArrowLeft',
  'ArrowRight',
  'Enter',
  'Escape',
  'Shift',
];

// ...

  private _handleComponentKeyDown = (ev: KeyboardEvent) => {
    const key = ev.key as ListenedKey;

    if (listenedKeys.includes(key)) {
      ev.stopPropagation();
      ev.preventDefault();
    }

    switch (key) {
        // NB: no handler for key === 'Escape'
        // ...
    }
}

any keyDown/keyPress events on a VscodeTree are not allowed to bubble up outside the tree, but the component itself does nothing with these events. Should 'Escaped' be removed from listenedKeys?

Happy to open a PR for this if needed. TIA!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions