fix sidebar shortcut activation on textarea: #6326

This commit is contained in:
btzr-io 2021-07-12 18:54:32 -05:00 committed by Thomas Zarebczan
parent e9710150ad
commit 2dbd5d0f00
2 changed files with 13 additions and 2 deletions

View file

@ -2040,5 +2040,8 @@
"Tip Creators": "Tip Creators",
"Only select creators can receive tips at this time": "Only select creators can receive tips at this time",
"The payment will be made from your saved card": "The payment will be made from your saved card",
"Trending for #Art": "Trending for #Art",
"Trending for #Education": "Trending for #Education",
"Trending for #Technology": "Trending for #Technology",
"--end--": "--end--"
}

View file

@ -9,7 +9,15 @@ import Icon from 'component/common/icon';
import NotificationBubble from 'component/notificationBubble';
import I18nMessage from 'component/i18nMessage';
import ChannelThumbnail from 'component/channelThumbnail';
import { PINNED_LABEL_1, PINNED_URI_1, PINNED_URI_2, PINNED_LABEL_2, SIMPLE_SITE, DOMAIN, ENABLE_UI_NOTIFICATIONS } from 'config';
import {
PINNED_LABEL_1,
PINNED_URI_1,
PINNED_URI_2,
PINNED_LABEL_2,
SIMPLE_SITE,
DOMAIN,
ENABLE_UI_NOTIFICATIONS,
} from 'config';
// @if TARGET='app'
import { IS_MAC } from 'component/app/view';
// @endif
@ -275,7 +283,7 @@ function SideNavigation(props: Props) {
if (e.keyCode === ESCAPE_KEY_CODE && isAbsolute) {
setSidebarOpen(false);
} else if (e.keyCode === BACKSLASH_KEY_CODE) {
const hasActiveInput = document.querySelector('input:focus');
const hasActiveInput = document.querySelector('input:focus, textarea:focus');
if (!hasActiveInput) {
setSidebarOpen(!sidebarOpen);
}