From 4dafa40882a56923dbc11834f9ca61054b94ef28 Mon Sep 17 00:00:00 2001 From: Haaxor1689 Date: Tue, 2 Jun 2020 09:34:17 +0200 Subject: [PATCH 1/3] Removed props.style.height type override --- src/index.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index aa67442d..3fe3cee6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -7,9 +7,7 @@ import { noop } from './utils'; type Style = Omit< NonNullable, 'maxHeight' | 'minHeight' -> & { - height?: number; -}; +>; export type TextareaAutosizeProps = JSX.IntrinsicElements['textarea'] & { maxRows?: number; From 9a2565e12b88a1df71e836ca71615b3d2d64a350 Mon Sep 17 00:00:00 2001 From: Haaxor1689 Date: Tue, 2 Jun 2020 09:40:14 +0200 Subject: [PATCH 2/3] Added changeset --- .changeset/long-seals-relax.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/long-seals-relax.md diff --git a/.changeset/long-seals-relax.md b/.changeset/long-seals-relax.md new file mode 100644 index 00000000..233e8739 --- /dev/null +++ b/.changeset/long-seals-relax.md @@ -0,0 +1,5 @@ +--- +'react-textarea-autosize': patch +--- + +Removed props.style.height type override From 419adbb2f07f3e1ac92c8d69e7f0d4223e2177ff Mon Sep 17 00:00:00 2001 From: Haaxor1689 Date: Wed, 3 Jun 2020 10:43:06 +0200 Subject: [PATCH 3/3] Changed type of textarea props --- .changeset/long-seals-relax.md | 3 ++- src/index.tsx | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.changeset/long-seals-relax.md b/.changeset/long-seals-relax.md index 233e8739..687b2784 100644 --- a/.changeset/long-seals-relax.md +++ b/.changeset/long-seals-relax.md @@ -2,4 +2,5 @@ 'react-textarea-autosize': patch --- -Removed props.style.height type override +- Removed props.style.height from `TextareaAutosizeProps`'s `style` prop. +- `TextareaAutosizeProps` now extends from `React.TextareaHTMLAttributes` instead of `JSX.IntrinsicElements['textarea']` to avoid problems with `ref` attribute. diff --git a/src/index.tsx b/src/index.tsx index 3fe3cee6..1c80f6b3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -6,10 +6,12 @@ import { noop } from './utils'; type Style = Omit< NonNullable, - 'maxHeight' | 'minHeight' + 'maxHeight' | 'minHeight' | 'height' >; -export type TextareaAutosizeProps = JSX.IntrinsicElements['textarea'] & { +export type TextareaAutosizeProps = React.TextareaHTMLAttributes< + HTMLTextAreaElement +> & { maxRows?: number; minRows?: number; onHeightChange?: (height: number) => void;