File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/react/src/components/presentation/UserProfile Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -235,10 +235,12 @@ const BaseUserProfile: FC<BaseUserProfileProps> = ({
235235 }
236236 // If editing, show field instead of value
237237 if ( isEditing && onEditValue && mutability !== 'READ_ONLY' ) {
238+ // Use editedUser value if available
239+ const fieldValue = editedUser && name && editedUser [ name ] !== undefined ? editedUser [ name ] : value || '' ;
238240 const commonProps = {
239241 label : undefined , // Don't show label in field, we render it outside
240242 required : required ,
241- value : value || '' ,
243+ value : fieldValue ,
242244 onChange : ( e : any ) => onEditValue ( e . target ? e . target . value : e ) ,
243245 style : {
244246 marginBottom : 0 ,
@@ -253,7 +255,7 @@ const BaseUserProfile: FC<BaseUserProfileProps> = ({
253255 field = < DatePicker { ...commonProps } /> ;
254256 break ;
255257 case 'BOOLEAN' :
256- field = < Checkbox { ...commonProps } checked = { value } onChange = { e => onEditValue ( e . target . checked ) } /> ;
258+ field = < Checkbox { ...commonProps } checked = { ! ! fieldValue } onChange = { e => onEditValue ( e . target . checked ) } /> ;
257259 break ;
258260 case 'COMPLEX' :
259261 field = < TextField { ...commonProps } /> ;
You can’t perform that action at this time.
0 commit comments