@zag-js/select
Advanced tools
Comparing version 0.0.0-dev-20240712143332 to 0.0.0-dev-20240714214509
@@ -524,3 +524,3 @@ "use strict"; | ||
loopFocus: false, | ||
closeOnSelect: true, | ||
closeOnSelect: !ctx.multiple, | ||
disabled: false, | ||
@@ -860,6 +860,3 @@ readOnly: false, | ||
isLastItemHighlighted: (ctx2) => ctx2.highlightedValue === ctx2.collection.lastValue, | ||
closeOnSelect: (ctx2, evt) => { | ||
if (ctx2.multiple) return false; | ||
return !!(evt.closeOnSelect ?? ctx2.closeOnSelect); | ||
}, | ||
closeOnSelect: (ctx2, evt) => !!(evt.closeOnSelect ?? ctx2.closeOnSelect), | ||
shouldRestoreFocus: (ctx2) => !!ctx2.restoreFocus, | ||
@@ -866,0 +863,0 @@ // guard assertions (for controlled mode) |
{ | ||
"name": "@zag-js/select", | ||
"version": "0.0.0-dev-20240712143332", | ||
"version": "0.0.0-dev-20240714214509", | ||
"description": "Core logic for the select widget implemented as a state machine", | ||
@@ -30,12 +30,12 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/anatomy": "0.0.0-dev-20240712143332", | ||
"@zag-js/core": "0.0.0-dev-20240712143332", | ||
"@zag-js/popper": "0.0.0-dev-20240712143332", | ||
"@zag-js/dom-query": "0.0.0-dev-20240712143332", | ||
"@zag-js/dom-event": "0.0.0-dev-20240712143332", | ||
"@zag-js/collection": "0.0.0-dev-20240712143332", | ||
"@zag-js/form-utils": "0.0.0-dev-20240712143332", | ||
"@zag-js/utils": "0.0.0-dev-20240712143332", | ||
"@zag-js/dismissable": "0.0.0-dev-20240712143332", | ||
"@zag-js/types": "0.0.0-dev-20240712143332" | ||
"@zag-js/anatomy": "0.0.0-dev-20240714214509", | ||
"@zag-js/core": "0.0.0-dev-20240714214509", | ||
"@zag-js/popper": "0.0.0-dev-20240714214509", | ||
"@zag-js/dom-query": "0.0.0-dev-20240714214509", | ||
"@zag-js/dom-event": "0.0.0-dev-20240714214509", | ||
"@zag-js/collection": "0.0.0-dev-20240714214509", | ||
"@zag-js/form-utils": "0.0.0-dev-20240714214509", | ||
"@zag-js/utils": "0.0.0-dev-20240714214509", | ||
"@zag-js/dismissable": "0.0.0-dev-20240714214509", | ||
"@zag-js/types": "0.0.0-dev-20240714214509" | ||
}, | ||
@@ -42,0 +42,0 @@ "devDependencies": { |
@@ -22,3 +22,3 @@ import { createMachine, guards } from "@zag-js/core" | ||
loopFocus: false, | ||
closeOnSelect: true, | ||
closeOnSelect: !ctx.multiple, | ||
disabled: false, | ||
@@ -369,6 +369,3 @@ readOnly: false, | ||
isLastItemHighlighted: (ctx) => ctx.highlightedValue === ctx.collection.lastValue, | ||
closeOnSelect: (ctx, evt) => { | ||
if (ctx.multiple) return false | ||
return !!(evt.closeOnSelect ?? ctx.closeOnSelect) | ||
}, | ||
closeOnSelect: (ctx, evt) => !!(evt.closeOnSelect ?? ctx.closeOnSelect), | ||
shouldRestoreFocus: (ctx) => !!ctx.restoreFocus, | ||
@@ -375,0 +372,0 @@ // guard assertions (for controlled mode) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
294486
4252
+ Added@zag-js/anatomy@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/collection@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/core@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/dismissable@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/dom-event@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/dom-query@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/form-utils@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/interact-outside@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/popper@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/store@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/text-selection@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/types@0.0.0-dev-20240714214509(transitive)
+ Added@zag-js/utils@0.0.0-dev-20240714214509(transitive)
- Removed@zag-js/anatomy@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/collection@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/core@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/dismissable@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/dom-event@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/dom-query@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/form-utils@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/interact-outside@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/popper@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/store@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/text-selection@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/types@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/utils@0.0.0-dev-20240712143332(transitive)