File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,13 @@ export default function autosize(textarea, {viewportMarginBottom = 100} = {}) {
5050
5151 const textareaStyle = getComputedStyle ( textarea )
5252
53- const topBorderWidth = Number ( textareaStyle . borderTopWidth . replace ( / p x / , '' ) )
54- const bottomBorderWidth = Number ( textareaStyle . borderBottomWidth . replace ( / p x / , '' ) )
53+ const topBorderWidth = parseFloat ( textareaStyle . borderTopWidth )
54+ const bottomBorderWidth = parseFloat ( textareaStyle . borderBottomWidth )
5555
5656 const isBorderBox = textareaStyle . boxSizing === 'border-box'
5757 const borderAddOn = isBorderBox ? topBorderWidth + bottomBorderWidth : 0
5858
59- const maxHeight = Number ( textareaStyle . height . replace ( / p x / , '' ) ) + bottom
59+ const maxHeight = parseFloat ( textareaStyle . height ) + bottom
6060 const adjustedViewportMarginBottom = bottom < viewportMarginBottom ? bottom : viewportMarginBottom
6161 textarea . style . maxHeight = `${ maxHeight - adjustedViewportMarginBottom } px`
6262
You can’t perform that action at this time.
0 commit comments