Skip to content

Commit 59f8b72

Browse files
committed
Added allowsSelectionDuringEditing property
1 parent 2292ba6 commit 59f8b72

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

RNTableView/RNTableView.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
@property(nonatomic) BOOL customCells;
3838
@property(nonatomic) BOOL editing;
3939
@property(nonatomic) BOOL moveWithinSectionOnly;
40+
@property(nonatomic) BOOL allowsSelectionDuringEditing;
4041
@property(nonatomic, assign) UIEdgeInsets contentInset;
4142
@property(nonatomic, assign) CGPoint contentOffset;
4243
@property(nonatomic, assign) UIEdgeInsets scrollIndicatorInsets;

RNTableView/RNTableView.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ - (void)setEditing:(BOOL)editing {
4141
[self.tableView setEditing:editing animated:YES];
4242
}
4343

44+
- (void)setAllowsSelectionDuringEditing:(BOOL)allowsSelectionDuringEditing {
45+
_allowsSelectionDuringEditing = allowsSelectionDuringEditing;
46+
47+
[self.tableView setAllowsSelectionDuringEditing: allowsSelectionDuringEditing];
48+
}
49+
4450
- (void)setSeparatorColor:(UIColor *)separatorColor {
4551
_separatorColor = separatorColor;
4652

@@ -210,6 +216,7 @@ - (void)createTableView {
210216
_tableView.delegate = self;
211217
_tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
212218
_tableView.allowsMultipleSelectionDuringEditing = NO;
219+
_tableView.allowsSelectionDuringEditing = self.allowsSelectionDuringEditing;
213220
_tableView.contentInset = self.contentInset;
214221
_tableView.contentOffset = self.contentOffset;
215222
_tableView.scrollIndicatorInsets = self.scrollIndicatorInsets;

src/TableView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class TableView extends React.Component {
196196
autoFocus: false,
197197
alwaysBounceVertical: true,
198198
scrollEnabled: true,
199+
allowsSelectionDuringEditing: false,
199200
sectionIndexTitlesEnabled: false,
200201
showsHorizontalScrollIndicator: true,
201202
showsVerticalScrollIndicator: true,

src/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ export interface TableViewProps {
232232
tableViewCellEditingStyle?: CellEditingStyle;
233233
separatorStyle?: SeparatorStyle;
234234
editing?: boolean;
235+
allowsSelectionDuringEditing?: boolean;
235236
autoFocusAnimate?: boolean;
236237
autoFocus?: boolean;
237238
alwaysBounceVertical?: boolean;

0 commit comments

Comments
 (0)