mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2026-02-06 02:06:29 +01:00
fix text input
This commit is contained in:
@@ -22,6 +22,12 @@ export default class TextInput extends React.Component<IProps, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static getDerivedStateFromProps(props: IProps, state: IState) {
|
static getDerivedStateFromProps(props: IProps, state: IState) {
|
||||||
|
if (!props.readOnly) {
|
||||||
|
return {
|
||||||
|
value: state.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return { value: props.value || '' }
|
return { value: props.value || '' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user