Skip to content

Commit

Permalink
fix(form): force-select "all fields" group and disable all others whe…
Browse files Browse the repository at this point in the history
…n changes panel is open

Co-authored-by: Robin Pyon <[email protected]>
  • Loading branch information
bjoerge and robinpyon committed Apr 20, 2023
1 parent e6bafe0 commit 755c337
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/sanity/src/core/form/store/formState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,15 @@ function prepareObjectInputState<T>(

// Set the "all-fields" group as selected when review changes is open to enable review of all
// fields and changes together. When review changes is closed - switch back to the selected tab.
const selected = (props.changesOpen && group.name === ALL_FIELDS_GROUP.name) || isSelected
const selected = props.changesOpen ? group.name === ALL_FIELDS_GROUP.name : isSelected
// Also disable non-selected groups when review changes is open
const disabled = props.changesOpen ? !selected : false

return groupHidden
? []
: [
{
disabled,
icon: group?.icon,
name: group.name,
selected,
Expand Down

0 comments on commit 755c337

Please sign in to comment.