Commit 0412425d authored by Michael Caldwell's avatar Michael Caldwell Committed by David Suissa
Browse files

Issue #3527344 by justcaldwell, erutan, dydave: Fixed support for new keyboard shortcuts for MacOS.

parent b244ce07
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
      ).forEach(() => {
        // Shortcut 'Alt + a' will focus on the search form.
        document.addEventListener('keydown', (event) => {
          if (event.altKey && event.key === 'a') {
          if (event.altKey && (event.key === 'a' || event.keyCode === 65)) {
            const searchInputField = context.getElementById(
              'admin-toolbar-search-input',
            );
@@ -38,6 +38,8 @@
                .click();
            }
            searchInputField.focus();
            // Don't transmit the keystroke.
            event.preventDefault();
          }
        });
      });
+3 −1
Original line number Diff line number Diff line
@@ -38,7 +38,9 @@

        // Shortcut 'Alt + p' will toggle the display of the toolbar.
        document.addEventListener('keydown', (event) => {
          if (event.altKey && event.key === 'p') {
          if (event.altKey && (event.key === 'p' || event.keyCode === 80)) {
            // Prevent transmitting keypress.
            event.preventDefault();
            // Toggle the display of the toolbar.
            this.toggle();
          }