mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-09 18:30:59 +00:00
Fixed ArrayController failed to recognize row 0 as the insert location
The logic is wrong in the test for last selection since it can be 0 and if there is no selection, [_selectionIndexes lastIndex] returns -1 Fixes #1723
This commit is contained in:
1 parent
c8b812bbb5
commit
009ae1e14c
1 file changed
+1
-1
@@ -914,7 +914,7 @@
|
||||
var newObject = [self automaticallyPreparesContent] ? [self newObject] : [self _defaultNewObject],
|
||||
lastSelectedIndex = [_selectionIndexes lastIndex];
|
||||
|
||||
if (lastSelectedIndex)
|
||||
if (lastSelectedIndex != CPNotFound)
|
||||
[self insertObject:newObject atArrangedObjectIndex:lastSelectedIndex];
|
||||
else
|
||||
[self addObject:newObject];
|
||||
|
||||
Reference in new issue
Block a user