@@ -45,7 +45,7 @@ const DeauthorizeHostStandalone = ({
4545 setDeauthorizeConfirmationOpen,
4646} : DeauthorizeHostStandaloneProps ) => {
4747 const cy = { "data-cy" : dataCy } ;
48- const [ deauthorizeReason , setDeauthorizeReason ] = useState < string > ( ) ;
48+ const [ deauthorizeReason , setDeauthorizeReason ] = useState < string > ( "" ) ;
4949 const { control : controlDeauthBasicInfo } = useForm < DeauthInputs > ( {
5050 mode : "all" ,
5151 } ) ;
@@ -71,10 +71,12 @@ const DeauthorizeHostStandalone = ({
7171 render = { ( { field } ) => (
7272 < TextField
7373 { ...field }
74- label = "Deauthorize reason (Optional) "
74+ label = "Reason for deauthorization "
7575 data-cy = "reason"
7676 onInput = { ( e ) => {
77- setDeauthorizeReason ( e . currentTarget . value ) ;
77+ const value = e . currentTarget . value ;
78+ setDeauthorizeReason ( value ) ;
79+ field . onChange ( value ) ;
7880 } }
7981 size = { InputSize . Large }
8082 className = "text-field-align"
@@ -109,6 +111,9 @@ const DeauthorizeHostStandalone = ({
109111 content = { deauthDialogContent }
110112 isOpen = { isDeauthConfirmationOpen }
111113 confirmBtnVariant = { ButtonVariant . Alert }
114+ confirmBtnDisabled = {
115+ ! deauthorizeReason || deauthorizeReason . trim ( ) . length === 0
116+ }
112117 confirmCb = { ( ) => deauthorizeHostFn ( deauthorizeReason ?? "" ) }
113118 confirmBtnText = "Deauthorize"
114119 cancelCb = { ( ) => setDeauthorizeConfirmationOpen ( false ) }
0 commit comments