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
604604
605605 self.onChange (newValue);
606606
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+ }
609613 } else if (editingStyle == UITableViewCellEditingStyleInsert) {
610614 NSMutableDictionary *newValue = [self dataForRow: indexPath.item section: indexPath.section];
611615 newValue[@" target" ] = self.reactTag ;
@@ -618,6 +622,11 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
618622 }
619623}
620624
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+
621630-(UITableViewCellEditingStyle)tableView : (UITableView *)tableView
622631 editingStyleForRowAtIndexPath : (NSIndexPath *)indexPath {
623632 return self.tableViewCellEditingStyle ;
Original file line number Diff line number Diff line change @@ -187,10 +187,20 @@ interface ItemProps {
187187 canMove ?: boolean
188188
189189 /**
190- * If cell can be deleted in editing mode
190+ * If cell can be deleted or edited in editing mode
191191 */
192192 canEdit ?: boolean
193193
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+
194204 /**
195205 * Cell selection style
196206 */
You can’t perform that action at this time.
0 commit comments