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 committed Oct 13, 2021
1 parent 417f3b8 commit 955e9de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,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: false,
valid: true
};
}
Expand Down Expand Up @@ -145,6 +145,10 @@ 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 });
};

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

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

Expand Down

0 comments on commit 955e9de

Please sign in to comment.