File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -63,13 +63,15 @@ function commitWithElement(event: MouseEvent) {
63
63
if ( ! ( event . target instanceof Element ) ) return
64
64
const target = event . target . closest ( '[role="option"]' )
65
65
if ( ! target ) return
66
- fireCommitEvent ( target )
67
66
event . preventDefault ( )
67
+ if ( target . getAttribute ( 'aria-disabled' ) === 'true' ) return
68
+ fireCommitEvent ( target )
68
69
}
69
70
70
71
function commit ( input : HTMLTextAreaElement | HTMLInputElement , list : HTMLElement ) : boolean {
71
72
const target = list . querySelector ( '[aria-selected="true"]' )
72
- if ( ! target || target . getAttribute ( 'aria-disabled' ) === 'true' ) return false
73
+ if ( ! target ) return false
74
+ if ( target . getAttribute ( 'aria-disabled' ) === 'true' ) return true
73
75
fireCommitEvent ( target )
74
76
return true
75
77
}
You can’t perform that action at this time.
0 commit comments