Skip to content

Commit

Permalink
Handle case element height equal zero (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer authored Apr 11, 2024
1 parent fe924bd commit 3ee55eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MarkdownTextInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ function getElementHeight(node: HTMLDivElement, styles: CSSProperties, numberOfL
node.parentElement.appendChild(tempElement);
const height = tempElement.clientHeight;
node.parentElement.removeChild(tempElement);
return `${height}px`;
return height ? `${height}px` : 'auto';
}
}
return `${styles.height}px` || 'auto';
return styles.height ? `${styles.height}px` : 'auto';
}

const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
Expand Down

0 comments on commit 3ee55eb

Please sign in to comment.