Skip to content

Commit

Permalink
STSMACOM-850: Trim value to validate required field in the Controlled…
Browse files Browse the repository at this point in the history
…Vocab component (#1505)
  • Loading branch information
mariia-aloshyna authored Aug 27, 2024
1 parent f20866f commit 4e1a4e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Add `requiredFields` prop to `DateRangeFilter` to support open-ended date ranges. STSMACOM-838.
* Provide `startLabel` and `endLabel` props in `<DateRangeFilter>` to enable unique accessible labeling. STSMACOM-848.
* Add `showSortIndicator` prop to `SearchAndSort` to display sort indicator next to the column names. STSMACOM-849.
* Trim value to validate required field in the `ControlledVocab` component. STSMACOM-850.

## [9.1.1] (IN PROGRESS)

Expand Down
2 changes: 1 addition & 1 deletion lib/ControlledVocab/ControlledVocab.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ class ControlledVocab extends React.Component {
const itemErrors = this.props.validate(item, index, items) || {};

// Check if the primary field has had data entered into it.
if (!item[primaryField]) {
if (!item[primaryField]?.trim()) {
itemErrors[primaryField] =
<FormattedMessage id="stripes-core.label.missingRequiredField" />;
}
Expand Down

0 comments on commit 4e1a4e9

Please sign in to comment.