Skip to content

Commit

Permalink
Changed type of textarea props
Browse files Browse the repository at this point in the history
  • Loading branch information
Haaxor1689 committed Jun 3, 2020
1 parent 9a2565e commit 419adbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .changeset/long-seals-relax.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLTextAreaElement>` instead of `JSX.IntrinsicElements['textarea']` to avoid problems with `ref` attribute.
6 changes: 4 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import { noop } from './utils';

type Style = Omit<
NonNullable<JSX.IntrinsicElements['textarea']['style']>,
'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;
Expand Down

0 comments on commit 419adbb

Please sign in to comment.