Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

enable ctrl+a for text inputs #1337

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Syntax: `- short text describing the change _(Your Name)_`
- _()_
- _()_
- _()_
- _()_
- Fixed bug to reenable Ctrl+A in text inputes _(Daniel Steinkogler)_
- _()_
- _()_
- _()_
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ const useAuthEffect = () => {
};

const handleGlobalKeyDown = (event: KeyboardEvent): void => {
// Prevent the default behavior of Ctrl+A to select all text
// Prevent the default behavior of Ctrl+A to select all text if the focus is not on an input or textarea
if (
document?.activeElement?.tagName === 'INPUT' ||
document?.activeElement?.tagName === 'TEXTAREA'
) {
return;
}

if (event.ctrlKey && event.key === 'a') {
event.preventDefault();
}
Expand Down