Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This is perhaps the first in our custom components. We encountered some bugs when using some components from the vscode-webview-ui-toolkit library. We can work around this, but for our purposes, it'll be easier to just have some custom components that work for our uses. This diff begins with a RadioGroup element, specifically due to an issue that happens with the vscode library Radio, where [it won't listen to onChange events correctly, often missing the first instance](microsoft/vscode-webview-ui-toolkit#404). It's possible to work around, but it's an easy footgun you have to test for. This is a simple radio implementation. It changes the API slightly from the microsoft one. Since you always expect to have multiple radio options, instead of having you render <Radio>s yourself, you just render one <RadioGroup> with a list of labels. Basically equivalent, but slightly easier IMO, since you don't need to set the value and name and everything yourself on each one, just define it once. We use very similar styles to the vscode webview ui toolkit, plus theme variables, so it doens't look out of place at all. Our focus behavior is slightly different, since we focus each radio option instead of the whole group. I actually thought that was weird behavior from the ui toolkit. Now we justused the normal DOM `<input type="radio">` behavior. Reviewed By: quark-zju Differential Revision: D54317950 fbshipit-source-id: f4310d04545a807f43d7db4c0105bbc8947fe13f
- Loading branch information