-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On first interaction the last Radio item in a Radio group is always selected #476
Comments
Also just to say this is the first extension that I've worked on since the UI toolkit has been available, and it's been a real boon so far. Great addition for helping make things more consistent. |
I'm having the same issue, in my case, it happens when rendering the vscode-radio-group, not just when clicking a vscode-radio, the last item is always checked. |
Hi all, it looks like this is a bug with FAST Foundation (the technology we use to build the toolkit), so I've gone ahead and bubbled the issue up to them. I'll keep this issue open to track the bug on the toolkit side of things and adopt the FAST change/fix once it lands :) In the meantime let me know if you have any questions and I'll do my best to answer them! |
Actually, a quick addendum/temporary solution! Looking at the FAST code again I think I realized what's going wrong. I believe the issue is caused when no explicit By explicitly adding So to be clear, this works: <vscode-radio-group>
<label slot="label">Radio Group Label</label>
<vscode-radio value="hi">Radio Label</vscode-radio>
<vscode-radio value="hello">Radio Label</vscode-radio>
<vscode-radio value="hey">Radio Label</vscode-radio>
</vscode-radio-group> And this does not: <vscode-radio-group>
<label slot="label">Radio Group Label</label>
<vscode-radio>Radio Label</vscode-radio>
<vscode-radio>Radio Label</vscode-radio>
<vscode-radio>Radio Label</vscode-radio>
</vscode-radio-group> |
I'm still leaving the FAST issue open and asking them to better handle when Please let me know if this works on your end and if there are any further issues you run into :) |
Description of changes Update radio docs (and associated CodeSandbox demos) to discuss and provide a warning about the upstream bug described in #476 and offer/demonstrate a workaround fix.
Hi all, Back with a final update: I'm very sorry to say that the toolkit is being deprecated and all active development will be coming to a close. There was an announcement last week where you can learn more details and leave any questions or comments you may have. Beyond that, thank you so much filing this issue and apologies for never getting around to addressing it. It means a lot that you contributed to the improvement of this project. I wish you all the best in your future VS Code extension endeavors! |
Describe the bug
We're currently using the
<VSCodeRadioGroup>
and<VSCodeRadio>
controls in a VS Code Webview. When you first try to click on any of the Radio Buttons the last button in the list will always be selected. After this first click / selection it will then work correctly from now on out.To reproduce
We are using the React Components in a webview, but I can reproduce this with the radio-group-sample CodeSandbox provided by this repo.
Expected behavior
The radio control that is clicked should be selected.
Current behavior
The last radio control in the group is selected.
Screenshots
Also this is non-blocking and I'm far from an HTML guru (so I might be misunderstanding).
But per the docs here: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event
I hooked up to the onChange of
<VSCodeRadio>
and currently I see it firing for the radio button that is being deselected or switched away from, and from the radio button that is being switched to. Per the docs I would have expected it only for the item that is being switched to.The text was updated successfully, but these errors were encountered: