Skip to content
This repository was archived by the owner on Jul 9, 2019. It is now read-only.

Commit 3f3c302

Browse files
author
Sonny
committed
fix: edit-list still in edit mode after deleting an item
1 parent 28cac86 commit 3f3c302

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-toolbox-components",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "Various react toolbox components",
55
"main": "dist/src/index.js",
66
"scripts": {

src/edit-list.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ export const EditList = enhance(({
168168
fields={mapFields ? mapFields(editFields, value) : editFields}
169169
buttonComponent={({disabled}) => <TableCell><Row horizontal='flex-end'>
170170
<IconButton icon='check' disabled={disabled} onClick={() => setEdit(null)} />
171-
<IconButton icon='delete' onClick={() => onChange(removeIn(i, list))} />
171+
<IconButton icon='delete' onClick={() => {
172+
setEdit(null)
173+
onChange(removeIn(i, list))
174+
}} />
172175
</Row></TableCell>}
173176
saveButton={true}
174177
/>

0 commit comments

Comments
 (0)