Skip to content

Commit 4ed9a69

Browse files
Merge pull request #426 from silevis/v4-fix/handle-cut-not-working-on-dropdown-cell
V4 fix: dropdown cell values are not clearing after being cut (cmd/ctrl-x)
2 parents 2fdab05 + 6d6b49a commit 4ed9a69

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/lib/CellTemplates/DropdownCellTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const DropdownInput: FC<DIProps> = ({ onCellChanged, cell }) => {
155155
onChange={(e) => onCellChanged({ ...cell, selectedValue: (e as OptionType).value, isOpen: false, inputValue: undefined })}
156156
blurInputOnSelect={true}
157157
defaultValue={selectedValue}
158-
value={selectedValue}
158+
value={selectedValue !== undefined ? selectedValue : null}
159159
isDisabled={cell.isDisabled}
160160
options={cell.values}
161161
onKeyDown={e => {

src/test/TestGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export const TestGrid: React.FC<TestGridProps> = (props) => {
254254
{ value: "vue", label: "Vue" },
255255
{ value: "angular", label: "Angular" },
256256
],
257-
currentValue: "react",
257+
currentValue: null,
258258
isDisabled: false,
259259
};
260260
case -1: // just for interface testing purposes

0 commit comments

Comments
 (0)