diff options
author | 2021-07-30 10:54:54 +0200 | |
---|---|---|
committer | 2021-07-30 14:24:54 +0530 | |
commit | f4b4416ea52d564bc2dbe543a82084ed98843ccc (patch) | |
tree | 7ca6b23571c86458a6b799746c91a7191de02715 /packages/forms/src/textarea/index.tsx | |
parent | 5.6.1-nightly.8 [skip ci] (diff) | |
download | ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.tar.gz ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.tar.zst ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.zip |
chore: migrate from tslint to @typescript-eslint (#1706)
- update .eslintrc to work for .js and .ts
- update devDependencies
- lint properly both root /src and nested /packages
- update webhint recommended setting for tsconfig.json to shrink output
- Manage all eslint rules from the repo root
- escape single quotes in scripts to please windows build
Co-authored-by: Vijay A <avijayr@protonmail.com>
Diffstat (limited to 'packages/forms/src/textarea/index.tsx')
-rw-r--r-- | packages/forms/src/textarea/index.tsx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/packages/forms/src/textarea/index.tsx b/packages/forms/src/textarea/index.tsx index 31c572d1c..2d89d1c9f 100644 --- a/packages/forms/src/textarea/index.tsx +++ b/packages/forms/src/textarea/index.tsx | |||
@@ -14,7 +14,10 @@ interface IData { | |||
14 | [index: string]: string; | 14 | [index: string]: string; |
15 | } | 15 | } |
16 | 16 | ||
17 | interface IProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, IFormField, IWithStyle { | 17 | interface IProps |
18 | extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, | ||
19 | IFormField, | ||
20 | IWithStyle { | ||
18 | focus?: boolean; | 21 | focus?: boolean; |
19 | data: IData; | 22 | data: IData; |
20 | textareaClassName?: string; | 23 | textareaClassName?: string; |
@@ -37,14 +40,14 @@ class TextareaComponent extends Component<IProps> { | |||
37 | const { data } = this.props; | 40 | const { data } = this.props; |
38 | 41 | ||
39 | if (this.textareaRef && this.textareaRef.current && data) { | 42 | if (this.textareaRef && this.textareaRef.current && data) { |
40 | Object.keys(data).map(key => this.textareaRef.current!.dataset[key] = data[key]); | 43 | Object.keys(data).map( |
44 | key => (this.textareaRef.current!.dataset[key] = data[key]), | ||
45 | ); | ||
41 | } | 46 | } |
42 | } | 47 | } |
43 | 48 | ||
44 | onChange(e: React.ChangeEvent<HTMLTextAreaElement>) { | 49 | onChange(e: React.ChangeEvent<HTMLTextAreaElement>) { |
45 | const { | 50 | const { onChange } = this.props; |
46 | onChange, | ||
47 | } = this.props; | ||
48 | 51 | ||
49 | if (onChange) { | 52 | if (onChange) { |
50 | onChange(e); | 53 | onChange(e); |
@@ -57,7 +60,6 @@ class TextareaComponent extends Component<IProps> { | |||
57 | className, | 60 | className, |
58 | disabled, | 61 | disabled, |
59 | error, | 62 | error, |
60 | focus, | ||
61 | id, | 63 | id, |
62 | textareaClassName, | 64 | textareaClassName, |
63 | label, | 65 | label, |
@@ -94,9 +96,9 @@ class TextareaComponent extends Component<IProps> { | |||
94 | [`${classes.wrapper}`]: true, | 96 | [`${classes.wrapper}`]: true, |
95 | [`${classes.disabled}`]: disabled, | 97 | [`${classes.disabled}`]: disabled, |
96 | [`${classes.hasError}`]: error, | 98 | [`${classes.hasError}`]: error, |
97 | })}> | 99 | })} |
100 | > | ||
98 | <textarea | 101 | <textarea |
99 | autoFocus={focus} | ||
100 | id={id} | 102 | id={id} |
101 | name={name} | 103 | name={name} |
102 | placeholder={placeholder} | 104 | placeholder={placeholder} |
@@ -115,9 +117,7 @@ class TextareaComponent extends Component<IProps> { | |||
115 | </textarea> | 117 | </textarea> |
116 | </div> | 118 | </div> |
117 | </Label> | 119 | </Label> |
118 | {error && ( | 120 | {error && <Error message={error} />} |
119 | <Error message={error} /> | ||
120 | )} | ||
121 | </Wrapper> | 121 | </Wrapper> |
122 | ); | 122 | ); |
123 | } | 123 | } |