Skip to content

Commit

Permalink
Only handle "Select All" when Term has focus (identified by document.…
Browse files Browse the repository at this point in the history
…activeElement).

Fixes vercel#6733.
  • Loading branch information
JJJ committed Jan 21, 2024
1 parent 2207fa9 commit aa17f39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/containers/hyper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const Hyper = forwardRef<HTMLDivElement, HyperProps>((props, ref) => {

const handleSelectAll = () => {
const term = terms.current?.getActiveTerm();
if (term) {
const focus = document.activeElement?.classList.contains('xterm-helper-textarea');
if (term && focus) {
term.selectAll();
}
};
Expand Down

0 comments on commit aa17f39

Please sign in to comment.