diff --git a/app/src/pages/common/membersPage/modals/inviteUserModal/inviteUserModal.jsx b/app/src/pages/common/membersPage/modals/inviteUserModal/inviteUserModal.jsx index 90342537a3..38b97fe9d7 100644 --- a/app/src/pages/common/membersPage/modals/inviteUserModal/inviteUserModal.jsx +++ b/app/src/pages/common/membersPage/modals/inviteUserModal/inviteUserModal.jsx @@ -161,7 +161,8 @@ export class InviteUserModal extends Component { areUserSuggestionsAllowed: PropTypes.bool.isRequired, projectName: PropTypes.string.isRequired, organizationSlug: PropTypes.string.isRequired, - valid: PropTypes.bool.isRequired, + invalid: PropTypes.bool.isRequired, + anyTouched: PropTypes.bool.isRequired, }; static defaultProps = { @@ -312,7 +313,8 @@ export class InviteUserModal extends Component { projectName, areUserSuggestionsAllowed, selectedUser, - valid, + anyTouched, + invalid, } = this.props; const okButton = { @@ -324,7 +326,7 @@ export class InviteUserModal extends Component { onClick: () => { handleSubmit(this.inviteUserAndCloseModal)(); }, - disabled: !valid, + disabled: anyTouched && invalid, eventInfo: MEMBERS_PAGE_EVENTS.INVITE_BTN_INVITE_USER_MODAL, 'data-automation-id': 'submitButton', }; diff --git a/app/src/pages/organization/organizationProjectsPage/modals/addProjectModal.jsx b/app/src/pages/organization/organizationProjectsPage/modals/addProjectModal.jsx index 050b1d8827..62a6414118 100644 --- a/app/src/pages/organization/organizationProjectsPage/modals/addProjectModal.jsx +++ b/app/src/pages/organization/organizationProjectsPage/modals/addProjectModal.jsx @@ -29,7 +29,7 @@ import { useDispatch } from 'react-redux'; import { messages } from '../messages'; const PROJECT_NAME_FIELD = 'projectName'; -export const AddProjectModal = ({ data = {}, handleSubmit, valid }) => { +export const AddProjectModal = ({ data = {}, handleSubmit, anyTouched, invalid }) => { const dispatch = useDispatch(); const { formatMessage } = useIntl(); const { onSubmit } = data; @@ -46,7 +46,7 @@ export const AddProjectModal = ({ data = {}, handleSubmit, valid }) => { onClick: () => { handleSubmit(onCreateProject)(); }, - disabled: !valid, + disabled: anyTouched && invalid, }} cancelButton={{ children: formatMessage(COMMON_LOCALE_KEYS.CANCEL), @@ -70,7 +70,8 @@ export const AddProjectModal = ({ data = {}, handleSubmit, valid }) => { AddProjectModal.propTypes = { data: PropTypes.object, handleSubmit: PropTypes.func, - valid: PropTypes.bool.isRequired, + anyTouched: PropTypes.bool.isRequired, + invalid: PropTypes.bool.isRequired, }; export default withModal('addProjectModal')(