File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ export function useManager({
9292 if ( value ) {
9393 if ( allowNew ) {
9494 opts . push ( {
95- disabled : typeof onValidate === 'function' ? ! onValidate ( value ) : false ,
95+ disabled : onValidate ? ! onValidate ( value ) : false ,
9696 label : newOptionText ,
9797 value : NewOptionValue ,
9898 } )
@@ -129,23 +129,19 @@ export function useManager({
129129 }
130130
131131 const api : ManagerAPI = {
132- listBoxCollapse ( newValue ?: string ) {
132+ listBoxCollapse ( value ?: string ) {
133133 if ( ! isExpanded ) return
134134
135- const collapse = onShouldCollapse ? onShouldCollapse ( newValue ?? state . value ) : true
136-
137- if ( collapse ) {
135+ if ( onShouldCollapse ? onShouldCollapse ( value ?? state . value ) : true ) {
138136 setIsExpanded ( false )
139137 setLastActiveOption ( null )
140138 onCollapse ?.( )
141139 }
142140 } ,
143- listBoxExpand ( newValue ?: string ) {
141+ listBoxExpand ( value ?: string ) {
144142 if ( isExpanded ) return
145143
146- const expand = onShouldExpand ? onShouldExpand ( newValue ?? state . value ) : true
147-
148- if ( expand ) {
144+ if ( onShouldExpand ? onShouldExpand ( value ?? state . value ) : true ) {
149145 setIsExpanded ( true )
150146 setLastActiveOption ( options [ activeIndex ] )
151147 onExpand ?.( )
You can’t perform that action at this time.
0 commit comments