Skip to content

Commit 11c198e

Browse files
committed
chore: fix updates
1 parent 872521b commit 11c198e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react/src/components/presentation/UserProfile/BaseUserProfile.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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} />;

0 commit comments

Comments
 (0)