Skip to content

Commit

Permalink
fix: resize style should be none when using autoSize (#7)
Browse files Browse the repository at this point in the history
* fix: resize style should be none when using autoSize

* fix: test case
  • Loading branch information
kerm1it authored Dec 17, 2020
1 parent 5b1eb56 commit 842bf80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/calculateNodeHeight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function calculateNodeHeight(
useCache = false,
minRows: number | null = null,
maxRows: number | null = null,
) {
): React.CSSProperties {
if (!hiddenTextarea) {
hiddenTextarea = document.createElement('textarea');
hiddenTextarea.setAttribute('tab-index', '-1');
Expand Down Expand Up @@ -162,5 +162,5 @@ export default function calculateNodeHeight(
height = Math.min(maxHeight, height);
}
}
return { height, minHeight, maxHeight, overflowY };
return { height, minHeight, maxHeight, overflowY, resize: 'none' };
}
2 changes: 2 additions & 0 deletions tests/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,15 @@ describe('TextArea', () => {
maxHeight: 9007199254740991,
minHeight: 2,
overflowY: undefined,
resize: 'none',
});
wrapper.style.boxSizing = 'content-box';
expect(calculateNodeHeight(wrapper, 1, 1)).toEqual({
height: -4,
maxHeight: 9007199254740991,
minHeight: -4,
overflowY: undefined,
resize: 'none',
});
});

Expand Down

0 comments on commit 842bf80

Please sign in to comment.