File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ export const NodeInputText: FC<NodeInputProps> = ({
1212 dispatchSubmit,
1313 error,
1414} ) => {
15+ const [ inputValue , setInputValue ] = React . useState ( attributes . value as string ) ;
16+
1517 const urlParams = new URLSearchParams ( window . location . search ) ;
1618 const isWebauthn = urlParams . get ( "webauthn" ) === "true" ;
1719 const ucFirst = ( s ?: string ) =>
@@ -26,10 +28,9 @@ export const NodeInputText: FC<NodeInputProps> = ({
2628 const isDuplicate = deduplicateValues . includes ( value as string ) ;
2729
2830 const message = node . messages . map ( ( { text } ) => text ) . join ( " " ) ;
29- const defaultValue = message . includes ( "Invalid login method" )
30- ? ( value as string )
31- : message ;
32-
31+ if ( message ) {
32+ setInputValue ( message ) ;
33+ }
3334 const getError = ( ) => {
3435 if ( message . startsWith ( "Invalid login method" ) ) {
3536 return "Invalid login method" ;
@@ -60,7 +61,7 @@ export const NodeInputText: FC<NodeInputProps> = ({
6061 name = { attributes . name }
6162 label = { getNodeLabel ( node ) }
6263 disabled = { disabled }
63- defaultValue = { defaultValue }
64+ value = { inputValue }
6465 error = { getError ( ) }
6566 onChange = { ( e ) => void setValue ( e . target . value ) }
6667 onKeyDown = { ( e ) => {
You can’t perform that action at this time.
0 commit comments