From fba634d51d347d2c0eddfd9b9110faef289662fc Mon Sep 17 00:00:00 2001 From: Cyrus <32754336+cyrusjc@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:25:30 -0700 Subject: [PATCH] Fixes #498: "Validation Message Should be User Friendly" (#764) * validated issueTitle by removing leading/trailing space * removed redundant bool type casting --- webapp/src/components/modals/create_issue/create_issue.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/src/components/modals/create_issue/create_issue.jsx b/webapp/src/components/modals/create_issue/create_issue.jsx index 1f8d565f1..25354955a 100644 --- a/webapp/src/components/modals/create_issue/create_issue.jsx +++ b/webapp/src/components/modals/create_issue/create_issue.jsx @@ -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;