Skip to content

Commit 1695091

Browse files
don't use null type to score
1 parent 5335d72 commit 1695091

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/utils/src/schema/getClosestMatchingOption.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ export function calculateIndexScore<T = any, S extends StrictRJSFSchema = RJSFSc
110110
calculateIndexScore<T, S, F>(validator, rootSchema, value as S, formValue, experimental_customMergeAllOf)
111111
);
112112
}
113-
if (value.type === guessType(formValue)) {
113+
const guessedType = guessType(formValue);
114+
if (guessType(formValue) !== 'null' && value.type === guessedType) {
114115
// If the types match, then we bump the score by one
115116
let newScore = score + 1;
116117
if (value.default) {

0 commit comments

Comments
 (0)