Commit 6e0b8328 authored by Jesús Espino's avatar Jesús Espino Committed by Harrison Healey
Browse files

Fix CTLR+SHIFT+L shortcut when the textbox is not visible (#1114)

parent c2ac94d5
......@@ -128,10 +128,19 @@ export default class NeedsTeam extends React.Component {
onShortcutKeyDown(e) {
if (e.shiftKey && Utils.cmdOrCtrlPressed(e) && Utils.isKeyPressed(e, Constants.KeyCodes.L)) {
if (document.getElementById('sidebar-right').className.match('sidebar--right sidebar--right--expanded')) {
document.getElementById('reply_textbox').focus();
} else {
document.getElementById('post_textbox').focus();
const sidebar = document.getElementById('sidebar-right');
if (sidebar) {
if (sidebar.className.match('sidebar--right move--left')) {
const replyTextbox = document.getElementById('reply_textbox');
if (replyTextbox) {
replyTextbox.focus();
}
} else {
const postTextbox = document.getElementById('post_textbox');
if (postTextbox) {
postTextbox.focus();
}
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment