File tree Expand file tree Collapse file tree 2 files changed +43
-10
lines changed
Expand file tree Collapse file tree 2 files changed +43
-10
lines changed Original file line number Diff line number Diff line change 1+ <!doctype html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > multi combo</ title >
7+ < link
8+ rel ="stylesheet "
9+ href ="/node_modules/@vscode/codicons/dist/codicon.css "
10+ id ="vscode-codicon-stylesheet "
11+ >
12+ < script
13+ type ="module "
14+ src ="/node_modules/@vscode-elements/webview-playground/dist/index.js "
15+ > </ script >
16+ < script type ="module " src ="/dist/main.js "> </ script >
17+ < script >
18+ const logEvents = ( selector , eventType ) => {
19+ document . querySelector ( selector ) . addEventListener ( eventType , ( ev ) => {
20+ console . log ( ev ) ;
21+ } ) ;
22+ } ;
23+ </ script >
24+ </ head >
25+
26+ < body >
27+ < main >
28+ < vscode-demo >
29+ < vscode-multi-select label ="Multi Select example ">
30+ < vscode-option selected > Lorem</ vscode-option >
31+ < vscode-option selected > Ipsum</ vscode-option >
32+ < vscode-option > Dolor</ vscode-option >
33+ </ vscode-multi-select >
34+ </ vscode-demo >
35+ </ main >
36+ </ body >
37+ </ html >
Original file line number Diff line number Diff line change @@ -321,6 +321,11 @@ export class VscodeMultiSelect
321321 this . _setFormValue ( ) ;
322322 this . _manageRequired ( ) ;
323323 }
324+
325+ protected override _onComboboxInputBlur ( ) : void {
326+ super . _onComboboxInputBlur ( ) ;
327+ this . _opts . filterPattern = '' ;
328+ }
324329 //#endregion
325330
326331 //#region render functions
@@ -336,15 +341,6 @@ export class VscodeMultiSelect
336341 }
337342
338343 protected override _renderComboboxFace ( ) : TemplateResult {
339- let inputVal = '' ;
340-
341- if ( this . _isBeingFiltered ) {
342- inputVal = this . _opts . filterPattern ;
343- } else {
344- const op = this . _opts . getSelectedOption ( ) ;
345- inputVal = op ?. label ?? '' ;
346- }
347-
348344 const activeDescendant =
349345 this . _opts . activeIndex > - 1 ? `op-${ this . _opts . activeIndex } ` : '' ;
350346 const expanded = this . open ? 'true' : 'false' ;
@@ -364,7 +360,7 @@ export class VscodeMultiSelect
364360 spellcheck="false"
365361 type="text"
366362 autocomplete="off"
367- .value=${ inputVal }
363+ .value=${ this . _opts . filterPattern }
368364 @focus=${ this . _onComboboxInputFocus }
369365 @blur=${ this . _onComboboxInputBlur }
370366 @input=${ this . _onComboboxInputInput }
You can’t perform that action at this time.
0 commit comments