Skip to content

Commit

Permalink
Merge pull request Expensify#17360 from rushatgabhane/fix-composer
Browse files Browse the repository at this point in the history
Fix: don't focus when key pressed in combination
  • Loading branch information
PauloGasparSv authored Apr 12, 2023
2 parents 8fd518c + ee3a27e commit 3cac462
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pages/home/report/ReportActionCompose/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,12 +479,17 @@ class ReportActionCompose extends React.Component {
return;
}

// if the key pressed is non-character keys like Enter, Shift, ... do not focus
// If the key pressed is non-character keys like Enter, Shift, ... do not focus
if (e.key.length > 1) {
return;
}

// if we're typing on another input/text area, do not focus
// If a key is pressed in combination with Meta, Control or Alt do not focus
if (e.metaKey || e.ctrlKey || e.altKey) {
return;
}

// If we're typing on another input/text area, do not focus
if (e.target.nodeName === 'INPUT' || e.target.nodeName === 'TEXTAREA') {
return;
}
Expand Down

0 comments on commit 3cac462

Please sign in to comment.