File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -604,8 +604,12 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
604
604
605
605
self.onChange (newValue);
606
606
607
- [_sections[indexPath.section][@" items" ] removeObjectAtIndex: indexPath.row];
608
- [self .tableView reloadData ];
607
+ if ([newValue[@" shouldOnlyEdit" ] boolValue ]) {
608
+ [self .tableView reloadRowsAtIndexPaths: @[indexPath] withRowAnimation: UITableViewRowAnimationNone];
609
+ } else {
610
+ [_sections[indexPath.section][@" items" ] removeObjectAtIndex: indexPath.row];
611
+ [self .tableView reloadData ];
612
+ }
609
613
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
610
614
NSMutableDictionary *newValue = [self dataForRow: indexPath.item section: indexPath.section];
611
615
newValue[@" target" ] = self.reactTag ;
@@ -618,6 +622,11 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
618
622
}
619
623
}
620
624
625
+ - (nullable NSString *)tableView : (UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath : (NSIndexPath *)indexPath {
626
+ NSDictionary *item = [self dataForRow: indexPath.item section: indexPath.section];
627
+ return item[@" buttonTitleOnEdit" ] ? item[@" buttonTitleOnEdit" ]: @" Delete" ;
628
+ }
629
+
621
630
-(UITableViewCellEditingStyle)tableView : (UITableView *)tableView
622
631
editingStyleForRowAtIndexPath : (NSIndexPath *)indexPath {
623
632
return self.tableViewCellEditingStyle ;
Original file line number Diff line number Diff line change @@ -187,10 +187,20 @@ interface ItemProps {
187
187
canMove ?: boolean
188
188
189
189
/**
190
- * If cell can be deleted in editing mode
190
+ * If cell can be deleted or edited in editing mode
191
191
*/
192
192
canEdit ?: boolean
193
193
194
+ /**
195
+ * If cell should be only edited without deletion of the cell in editing mode
196
+ */
197
+ shouldOnlyEdit ?: boolean
198
+
199
+ /**
200
+ * Custom button title in editing mode, default is "Delete" without localization support
201
+ */
202
+ buttonTitleOnEdit ?: string
203
+
194
204
/**
195
205
* Cell selection style
196
206
*/
You can’t perform that action at this time.
0 commit comments