Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/web/app/(builder)/lib/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ function mergeUpdates<T extends object>(target: T, source: Partial<T>) {
!Array.isArray(targetValue)
) {
mergeUpdates(targetValue as object, sourceValue as object);
} else if (sourceValue !== undefined) {
} else if (sourceValue === undefined) {
// Explicitly cleared — remove the key so field defaults take effect
delete target[key];
} else {
target[key] = sourceValue as T[keyof T];
}
}
Expand Down
8 changes: 4 additions & 4 deletions apps/web/registry/base/fields/checkbox-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ function getOptionGroupLayoutClassName({
columns?: OptionGroupColumns;
}) {
const usesGridColumns = variant === "card" || direction === "horizontal";
const effectiveColumns = usesGridColumns ? columns : undefined;
// Default to 2 columns for horizontal direction so users see immediate feedback
const effectiveColumns = usesGridColumns
? (columns ?? (direction === "horizontal" ? 2 : undefined))
: undefined;

if (!effectiveColumns || effectiveColumns === 1) {
if (variant === "default" && direction === "horizontal") {
return "flex flex-wrap gap-x-4 gap-y-2";
}
return "flex flex-col gap-2";
}

Expand Down
8 changes: 4 additions & 4 deletions apps/web/registry/base/fields/radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ function getOptionGroupLayoutClassName({
columns?: OptionGroupColumns;
}) {
const usesGridColumns = variant === "card" || direction === "horizontal";
const effectiveColumns = usesGridColumns ? columns : undefined;
// Default to 2 columns for horizontal direction so users see immediate feedback
const effectiveColumns = usesGridColumns
? (columns ?? (direction === "horizontal" ? 2 : undefined))
: undefined;

if (!effectiveColumns || effectiveColumns === 1) {
if (variant === "default" && direction === "horizontal") {
return "flex flex-wrap gap-x-4 gap-y-2";
}
return "flex flex-col gap-2";
}

Expand Down
Loading