Skip to content

Commit f870538

Browse files
committed
🐛 Fix disabling a field if 'all' is set before
Closes #27
1 parent 1f6d629 commit f870538

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/blocks/imprint/controls.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ export default function SidebarControls( props ) {
1515
.sort();
1616

1717
const onChangeEnabledField = ( key, value ) => {
18-
const newValue = structuredClone( enabledFields );
18+
let newValue = structuredClone( enabledFields );
1919

2020
if ( value ) {
2121
newValue.push( key );
2222
} else {
23+
if ( newValue.indexOf( 'all' ) > -1 ) {
24+
newValue = supportedFields;
25+
}
26+
2327
const index = newValue.indexOf( key );
2428

2529
if ( index !== -1 ) {

0 commit comments

Comments
 (0)