Closed bensgith closed 10 months ago
Sorry, please forget about this issue.
I just found that I missed the ()
at the end of called function checkWeather
. It works now after I put it back as checkWeather();
Nice! Happy to hear you figured it out!
Describe the bug
I'm new to TypeScript. I'm trying to learn it and build my VS Code extension basing on this sample https://github.com/microsoft/vscode-webview-ui-toolkit-samples/tree/main/default/weather-webview
I was trying to add a tiny feature: When finished typing in location text field, I can just press "Enter" to check the weather. No need to use mouse to click "Check" button.
But looks like it did work with the function
addEventListener("keydown", myFunction);
Here is my only change on
src/webview/main.ts
file:To reproduce
git clone https://github.com/microsoft/vscode-webview-ui-toolkit-samples.git
to down the repovscode-webview-ui-toolkit-samples\default\weather-webview
npm install
to download dependencies and librariesnpm run compile
to compile the codeExpected behavior
When finished typing in location text field, I can just press "Enter" to check the weather. No need to use mouse to click "Check" button.
Current behavior
Not working or showing any error
Screenshots
Desktop (please complete the following information):
Windows 10
v1.3.1
Additional context