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

#86: wrong max height when using maxRows and boxSizing "border-box" (closes #86) #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions src/TextareaAutosize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,16 @@ export default class TextareaAutosize extends React.Component<TextareaAutosize.P
saveDOMNodeRef
} = this;

const maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null;
const maxHeight = typeof maxRows !== 'undefined' && lineHeight ? lineHeight * maxRows : null;

return {
...props,
saveDOMNodeRef,
style: maxHeight ? { ...style, maxHeight } : style,
style: maxHeight ? {
boxSizing: typeof maxRows !== 'undefined' ? 'content-box' : undefined,
...style,
maxHeight
} : style,
onChange: this.onChange
};
}
Expand Down