elements icon indicating copy to clipboard operation
elements copied to clipboard

creatable single-select error on enter key

Open vaclavHala opened this issue 7 months ago • 0 comments

using vscode-elements 1.16.1

I have single select created like this

<vscode-single-select creatable combobox>
    <vscode-option>foo</vscode-option>
    <vscode-option>bar</vscode-option>
</vscode-single-select>

When I want to add option xxx at runtime I can do that by typing in xxx and then manually selecting the synthetic option Add "xxx" that gets added into the options box.

What I'd also like to do is have the same behavior when I hit enter key after typing in the new value, unfortunately that does not work and prints this error in the dev console

Uncaught TypeError: Cannot read properties of undefined (reading 'index')
    at VscodeSingleSelect._onEnterKeyDown (19_webviewAccess.js:21236:72)
    at VscodeSingleSelect._onEnterKeyDown (19_webviewAccess.js:22222:15)
    at VscodeSelectBase._onComponentKeyDown (19_webviewAccess.js:21002:22)

my extension is bundled, the line numbers point at this code https://github.com/vscode-elements/elements/blob/v1.16.1/src/includes/vscode-select/vscode-select-base.ts#L494

vaclavHala avatar May 26 '25 09:05 vaclavHala