Skip to content

Commit

Permalink
Don't check navigator outside of component
Browse files Browse the repository at this point in the history
If we render in SSR mode, the navigator check will fail.
  • Loading branch information
jdeichert committed Nov 25, 2024
1 parent db375be commit 28b843d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/components/src/InputText/InputText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import {
import { isFirefox } from "../utils/getClientBrowser";
import { TOOLBAR_TOTAL_HEIGHT } from "../FormField/FormFieldWrapper";

const IS_FIREFOX = isFirefox(navigator.userAgent);

export interface RowRange {
min: number;
max: number;
Expand Down Expand Up @@ -154,7 +152,9 @@ function InputTextInternal(
// Firefox has a bug where it doesn't take the toolbar space into account, so we need
// to include that in the maxHeight calculation.
const firefoxOffset =
IS_FIREFOX && props.toolbar ? TOOLBAR_TOTAL_HEIGHT : 0;
isFirefox(navigator.userAgent) && props.toolbar
? TOOLBAR_TOTAL_HEIGHT
: 0;

const maxHeight =
rowRange.max * parseFloat(lineHeight) +
Expand Down

0 comments on commit 28b843d

Please sign in to comment.