Skip to content

Commit

Permalink
[env:jsx] Update HTMLTextAreaElement (#4462)
Browse files Browse the repository at this point in the history
* [env:jsx] Update HTMLTextAreaElement definition

* [env:jsx] Update test HTMLTextAreaElement
  • Loading branch information
gabrielvieiradev committed Jun 29, 2023
1 parent 2cac201 commit bf70d9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions definitions/environments/jsx/flow_v0.83.x-/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,19 @@ declare type jsx$HTMLTextAreaElement = {
* If this attribute is not specified, soft is its default value.
*/
wrap?: 'hard' | 'soft' | 'off',
/**
* React specific : Control the text inside the textarea.
*/
value?: string,
/**
* React specific : Specifies the initial value for a text area.
*/
defaultValue?: string
/**
* React specific: An Event handler function. Required for controlled text areas. Fires immediately when the input’s value is changed by the user (for example, it fires on every keystroke).
* Behaves like the browser input event.
*/
onChange?: (evt: SyntheticEvent<HTMLTextAreaElement>) => mixed,
...
};

Expand Down
1 change: 1 addition & 0 deletions definitions/environments/jsx/flow_v0.83.x-/test_jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ describe('jsx', () => {
<TextArea autoComplete={true} />;
// $FlowExpectedError[incompatible-type]
<TextArea autoComplete="yes" />;
<TextArea value="foo" onChange={(evt) => { (evt.currentTarget.rows: number) }} />;
});
});

Expand Down

0 comments on commit bf70d9a

Please sign in to comment.