-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STCOM-715 Correct validation for User Record Custom Fields MultiSelec…
…tion (#1328) Correctly present validation error for `<MultiSelection>` component if it has no value and disable `Save&Close` button Refs STCOM-715 Co-authored-by: Denys Bohdan <[email protected]>
- Loading branch information
1 parent
8c2628a
commit 06e0f36
Showing
6 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import css from './MultiSelect.css'; | ||
|
||
const propTypes = { | ||
ariaLabelledBy: PropTypes.string, | ||
getInputProps: PropTypes.func.isRequired, | ||
id: PropTypes.string.isRequired, | ||
required: PropTypes.bool, | ||
value: PropTypes.string, | ||
}; | ||
|
||
const MultiSelectValueInput = ({ | ||
ariaLabelledBy, | ||
id, | ||
required, | ||
getInputProps, | ||
value, | ||
...rest | ||
}) => ( | ||
<input | ||
{...getInputProps({ | ||
'aria-labelledby': rest['aria-labelledby'] || ariaLabelledBy, | ||
type: 'text', | ||
id, | ||
className: css.multiSelectValueInput, | ||
required, | ||
value, | ||
tabindex: '-1', | ||
})} | ||
/> | ||
); | ||
|
||
MultiSelectValueInput.propTypes = propTypes; | ||
|
||
MultiSelectValueInput.defaultProps = { | ||
required: false, | ||
}; | ||
|
||
export default MultiSelectValueInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters