Skip to content

Commit

Permalink
Laget variabel TASTATURTAST_ENTER for å gjøre koden mer lesbar.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnsteingarmo committed Oct 29, 2024
1 parent cb09442 commit 8f08b77
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const StyledDropdownMenu = styled(Dropdown.Menu)`
`;

const TASTATURTAST_K = 'k';
const TASTATURTAST_ENTER = 'Enter';

const BeregnetInntektKalkulator: FC<{
leggTilBeregnetInntektTekstIBegrunnelse: (årsinntekt: number) => void;
Expand All @@ -35,7 +36,7 @@ const BeregnetInntektKalkulator: FC<{
};

const handleRegnUtOgLeggTilTekst = (event: React.KeyboardEvent<HTMLInputElement>) => {
if (event.key === 'Enter') {
if (event.key === TASTATURTAST_ENTER) {
event.preventDefault();
oppdaterÅrsinntekt();
}
Expand Down

0 comments on commit 8f08b77

Please sign in to comment.