File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/0/src/composables/useSingle Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export function useSingle<
39
39
E extends SingleContext < Z > = SingleContext < Z > ,
40
40
> ( options ?: SingleOptions ) : E {
41
41
const registry = useSelection < Z , E > ( options )
42
- const mandatory = options ?. mandatory ?? true
42
+ const mandatory = options ?. mandatory ?? false
43
43
44
44
const selectedId = computed ( ( ) => registry . selectedIds . values ( ) . next ( ) . value )
45
45
const selectedItem = computed ( ( ) => registry . selectedItems . value . values ( ) . next ( ) . value )
@@ -51,7 +51,7 @@ export function useSingle<
51
51
if ( ! item || item . disabled ) return
52
52
53
53
registry . selectedIds . clear ( )
54
- registry . selectedIds . add ( id )
54
+ registry . select ( id )
55
55
}
56
56
57
57
function unselect ( id : ID ) {
You can’t perform that action at this time.
0 commit comments