Skip to content
Snippets Groups Projects
Unverified Commit 138a8b09 authored by Aleksandr Lesnenko's avatar Aleksandr Lesnenko Committed by GitHub
Browse files

fix parameter input loses value (#23750)

parent 26f4673e
No related merge requests found
......@@ -21,11 +21,6 @@ type State = {
};
class TextWidget extends React.Component<Props, State> {
state: State = {
value: null,
isFocused: false,
};
static defaultProps = {
isEditing: false,
commitImmediately: false,
......@@ -34,6 +29,11 @@ class TextWidget extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
value: props.value,
isFocused: false,
};
}
static noPopover = true;
......@@ -43,7 +43,7 @@ class TextWidget extends React.Component<Props, State> {
}
UNSAFE_componentWillReceiveProps(nextProps: Props) {
if (nextProps.value !== this.state.value) {
if (nextProps.value !== this.props.value) {
this.setState({ value: nextProps.value }, () => {
// HACK: Address Safari rendering bug which causes https://github.com/metabase/metabase/issues/5335
forceRedraw(ReactDOM.findDOMNode(this));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment