Skip to content

Commit 755c337

Browse files
bjoergerobinpyon
andcommittedApr 20, 2023
fix(form): force-select "all fields" group and disable all others when changes panel is open
Co-authored-by: Robin Pyon <robin.pyon@gmail.com>
1 parent e6bafe0 commit 755c337

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎packages/sanity/src/core/form/store/formState.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,15 @@ function prepareObjectInputState<T>(
510510

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

515517
return groupHidden
516518
? []
517519
: [
518520
{
521+
disabled,
519522
icon: group?.icon,
520523
name: group.name,
521524
selected,

0 commit comments

Comments
 (0)
Failed to load comments.