Skip to content

Commit

Permalink
fix: hide readonly option when disabled is active
Browse files Browse the repository at this point in the history
Closes #1063
  • Loading branch information
Skaiir committed Feb 21, 2024
1 parent f6ffe25 commit e152d61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Disabled(props) {
getValue,
id,
label: 'Disabled',
tooltip: 'Field cannot be edited by the end-user, and the data is not submitted.',
tooltip: 'Field cannot be edited by the end-user, and the data is not submitted. Takes precedence over read only.',
inline: true,
setValue
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,22 @@ export function ReadonlyEntry(props) {
field
} = props;

const {
disabled
} = field;

const entries = [];

entries.push({
id: 'readonly',
component: Readonly,
editField: editField,
field: field,
isEdited: isFeelEntryEdited,
isDefaultVisible: (field) => INPUTS.includes(field.type)
});
if (!disabled) {
entries.push({
id: 'readonly',
component: Readonly,
editField: editField,
field: field,
isEdited: isFeelEntryEdited,
isDefaultVisible: (field) => INPUTS.includes(field.type)
});
}

return entries;
}
Expand Down

0 comments on commit e152d61

Please sign in to comment.