diff --git a/addons/isl/src/PartialFileSelection.tsx b/addons/isl/src/PartialFileSelection.tsx index 5d2544b53267b..1264fd2237a6b 100644 --- a/addons/isl/src/PartialFileSelection.tsx +++ b/addons/isl/src/PartialFileSelection.tsx @@ -11,7 +11,7 @@ import type {ChunkSelectState, LineRegion, SelectLine} from './stackEdit/chunkSe import {TextEditable} from './TextEditable'; import {VSCodeCheckbox} from './VSCodeCheckbox'; import {T, t} from './i18n'; -import {VSCodeRadio} from '@vscode/webview-ui-toolkit/react'; +import {VSCodeRadio, VSCodeRadioGroup} from '@vscode/webview-ui-toolkit/react'; import {Set as ImSet} from 'immutable'; import {useRef, useState} from 'react'; import {notEmpty} from 'shared/utils'; @@ -28,23 +28,25 @@ export type PartialFileEditMode = 'unified' | 'side-by-side' | 'free-edit'; export function PartialFileSelection(props: Props) { const [editMode, setEditMode] = useState('unified'); + // vscode-webview-ui-toolkit has poor typescript definitions on events. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const handleChange = (e: any) => { + setEditMode(e.target.value); + }; + return (
- {/* Cannot use VSCodeRadioGroup. See https://github.com/microsoft/vscode-webview-ui-toolkit/issues/404 */} - {/* FIXME: VSCodeRadio onClick does not fire on keyboard events (ex. tab, then space) */} -
- setEditMode('unified')}> + + Unified - setEditMode('side-by-side')}> + Side-by-side - setEditMode('free-edit')}> + Freeform edit -
+
);