Skip to content

Commit

Permalink
Fixes #498: "Validation Message Should be User Friendly" (#764)
Browse files Browse the repository at this point in the history
* validated issueTitle by removing leading/trailing space

* removed redundant bool type casting
  • Loading branch information
cyrusjc committed Apr 23, 2024
1 parent f826788 commit fba634d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webapp/src/components/modals/create_issue/create_issue.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ export default class CreateIssueModal extends PureComponent {
e.preventDefault();
}

if (!this.validator.validate() || !this.state.issueTitle) {
const isValidTitle = this.state.issueTitle.trim().length !== 0;
if (!this.validator.validate() || !isValidTitle) {
this.setState({
issueTitleValid: Boolean(this.state.issueTitle),
issueTitleValid: isValidTitle,
showErrors: true,
});
return;
Expand Down

0 comments on commit fba634d

Please sign in to comment.