Skip to content

Commit

Permalink
HBW-366 Don't highlight multi nullable select_table
Browse files Browse the repository at this point in the history
  • Loading branch information
Salavat Dautov authored and hydra-billing-robot committed Oct 14, 2021
1 parent 8623825 commit a3603f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ v2.6.14 [unreleased]
-------------------
### Bugfixes
- [#601](https://github.com/latera/homs/pull/601) Move fontawesome to public/assets.
- [#603](https://github.com/latera/homs/pull/603) Don't highlight multi nullable select_table.
v2.6.13 [2021-09-03]
-------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ modulejs.define('HBWFormSelectTable',
this.state = {
value: Array.isArray(value) ? value.map(el => String(el)) : String(value),
choices: this.getChoices(),
error: (!props.hasValueInChoices(value) && value) || props.missFieldInVariables(),
error: props.missFieldInVariables(),
valid: true
};
}
Expand Down Expand Up @@ -145,6 +145,12 @@ modulejs.define('HBWFormSelectTable',
this.setState({ valid: this.props.isValid(this.state.value) });
};

setErrorState = () => {
this.setState({
error: (this.state.value.length === 0 && !this.props.params.nullable) || this.props.missFieldInVariables()
});
};

controlValidationTooltip = (toHide) => {
if (toHide) {
this.tooltip.hide();
Expand Down Expand Up @@ -184,6 +190,7 @@ modulejs.define('HBWFormSelectTable',

onValueUpdate = () => {
this.setValidationState();
this.setErrorState();
this.props.fireFieldValueUpdate(this.props.name, this.state.value);
}

Expand Down

0 comments on commit a3603f2

Please sign in to comment.