From a888400aac1658efada8916e4cc58b5e8afce04c Mon Sep 17 00:00:00 2001 From: bendera Date: Fri, 5 Sep 2025 23:57:27 +0200 Subject: [PATCH 1/4] Fix preselected option shows in MultiSelect --- dev/vscode-multi-select/issue-510.html | 37 +++++++++++++++++++ .../vscode-multi-select.ts | 16 +++----- 2 files changed, 43 insertions(+), 10 deletions(-) create mode 100644 dev/vscode-multi-select/issue-510.html diff --git a/dev/vscode-multi-select/issue-510.html b/dev/vscode-multi-select/issue-510.html new file mode 100644 index 000000000..0ef9440dd --- /dev/null +++ b/dev/vscode-multi-select/issue-510.html @@ -0,0 +1,37 @@ + + + + + + multi combo + + + + + + + +
+ + + Lorem + Ipsum + Dolor + + +
+ + diff --git a/src/vscode-multi-select/vscode-multi-select.ts b/src/vscode-multi-select/vscode-multi-select.ts index 0e9f8a14b..5ac841860 100644 --- a/src/vscode-multi-select/vscode-multi-select.ts +++ b/src/vscode-multi-select/vscode-multi-select.ts @@ -321,6 +321,11 @@ export class VscodeMultiSelect this._setFormValue(); this._manageRequired(); } + + protected override _onComboboxInputBlur(): void { + super._onComboboxInputBlur(); + this._opts.filterPattern = ''; + } //#endregion //#region render functions @@ -336,15 +341,6 @@ export class VscodeMultiSelect } protected override _renderComboboxFace(): TemplateResult { - let inputVal = ''; - - if (this._isBeingFiltered) { - inputVal = this._opts.filterPattern; - } else { - const op = this._opts.getSelectedOption(); - inputVal = op?.label ?? ''; - } - const activeDescendant = this._opts.activeIndex > -1 ? `op-${this._opts.activeIndex}` : ''; const expanded = this.open ? 'true' : 'false'; @@ -364,7 +360,7 @@ export class VscodeMultiSelect spellcheck="false" type="text" autocomplete="off" - .value=${inputVal} + .value=${this._opts.filterPattern} @focus=${this._onComboboxInputFocus} @blur=${this._onComboboxInputBlur} @input=${this._onComboboxInputInput} From 410721faec421a4d1deef2dc5365c96da77262de Mon Sep 17 00:00:00 2001 From: dankeboy36 Date: Thu, 11 Sep 2025 13:23:23 +0200 Subject: [PATCH 2/4] fix: macOS multi-select uses Cmd instead of Ctrl Closes: vscode-elements/elements#532 Signed-off-by: dankeboy36 --- src/vscode-tree-item/vscode-tree-item.ts | 7 +++++-- src/vscode-tree/vscode-tree.test.ts | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/vscode-tree-item/vscode-tree-item.ts b/src/vscode-tree-item/vscode-tree-item.ts index e39c96123..e92937095 100644 --- a/src/vscode-tree-item/vscode-tree-item.ts +++ b/src/vscode-tree-item/vscode-tree-item.ts @@ -323,7 +323,7 @@ export class VscodeTreeItem extends VscElement { private _handleContentClick(ev: MouseEvent) { ev.stopPropagation(); - const isCtrlDown = ev.ctrlKey; + const isCtrlDown = ev.ctrlKey || ev.metaKey; const isShiftDown = ev.shiftKey; if (isShiftDown && this._configContext.multiSelect) { @@ -356,7 +356,10 @@ export class VscodeTreeItem extends VscElement { private _handleDoubleClick(ev: MouseEvent) { if (this._configContext.expandMode === ExpandMode.doubleClick) { - if (this.branch && !(this._configContext.multiSelect && ev.ctrlKey)) { + if ( + this.branch && + !(this._configContext.multiSelect && (ev.ctrlKey || ev.metaKey)) + ) { this.open = !this.open; } } diff --git a/src/vscode-tree/vscode-tree.test.ts b/src/vscode-tree/vscode-tree.test.ts index 16fe0eba2..25b8abdb2 100644 --- a/src/vscode-tree/vscode-tree.test.ts +++ b/src/vscode-tree/vscode-tree.test.ts @@ -623,11 +623,13 @@ describe('vscode-tree', () => { ` ); + const isMac = window.navigator.userAgent.includes('Mac'); + const downKey = isMac ? 'Meta' : 'Control'; await clickOnElement($('#item1')); - await sendKeys({down: 'Control'}); + await sendKeys({down: downKey}); await clickOnElement($('#item3')); await clickOnElement($('#item5')); - await sendKeys({up: 'Control'}); + await sendKeys({up: downKey}); expect($('#item1').selected).to.be.true; expect($('#item2').selected).to.be.false; From 0bb29f28ae0579567441e4fd3f7447981a60226e Mon Sep 17 00:00:00 2001 From: dankeboy36 Date: Thu, 11 Sep 2025 13:24:19 +0200 Subject: [PATCH 3/4] chore: run CI on all major platforms Signed-off-by: dankeboy36 --- .github/workflows/verify.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 046bdbd49..0e711b736 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -4,7 +4,12 @@ on: pull_request jobs: verify: - runs-on: ubuntu-latest + name: Verify (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] steps: - name: Clone Repository uses: actions/checkout@v5 From dd660171b17737d8fb504934729a155321ab3e0d Mon Sep 17 00:00:00 2001 From: bendera Date: Fri, 12 Sep 2025 23:21:46 +0200 Subject: [PATCH 4/4] Add gitattributes --- .gitattributes | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..9dba9dfba --- /dev/null +++ b/.gitattributes @@ -0,0 +1,32 @@ +# Auto detect text files and enforce LF line endings +* text=auto eol=lf + +# Source code +*.js text eol=lf +*.mjs text eol=lf +*.ts text eol=lf +*.json text eol=lf +*.html text eol=lf +*.css text eol=lf + +# Documentation +*.md text eol=lf + +# Config files +*.yml text eol=lf +*.yaml text eol=lf +*.config text eol=lf +*.lock text eol=lf +.gitattributes text eol=lf +.gitignore text eol=lf +.editorconfig text eol=lf +.ncurc text eol=lf +.mailmap text eol=lf + +# Graphics +*.svg text eol=lf +*.woff binary +*.woff2 binary +*.ttf binary +*.eot binary +*.ico binary