diff --git a/ts/components/LeftPane.tsx b/ts/components/LeftPane.tsx index ebd220bfbd..79d6afa5be 100644 --- a/ts/components/LeftPane.tsx +++ b/ts/components/LeftPane.tsx @@ -348,8 +348,30 @@ export const LeftPane: React.FC = ({ // It also ensures that we scroll to the top when switching views. const listKey = preRowsNode ? 1 : 0; + // We disable this lint rule because we're trying to capture bubbled events. See [the + // lint rule's docs][0]. + // + // [0]: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/645900a0e296ca7053dbf6cd9e12cc85849de2d5/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events + /* eslint-disable jsx-a11y/no-static-element-interactions */ return ( -
+
{ + if (event.key === 'Escape') { + const backAction = helper.getBackAction({ + showInbox, + startComposing, + showChooseGroupMembers, + }); + if (backAction) { + event.preventDefault(); + event.stopPropagation(); + backAction(); + } + } + }} + > + {/* eslint-enable jsx-a11y/no-static-element-interactions */}
{helper.getHeaderContents({ i18n, diff --git a/ts/components/leftPane/LeftPaneArchiveHelper.tsx b/ts/components/leftPane/LeftPaneArchiveHelper.tsx index 634bbc9cbb..1a2715dd89 100644 --- a/ts/components/leftPane/LeftPaneArchiveHelper.tsx +++ b/ts/components/leftPane/LeftPaneArchiveHelper.tsx @@ -39,7 +39,7 @@ export class LeftPaneArchiveHelper extends LeftPaneHelper< return (