File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -427,12 +427,14 @@ class NoteList extends React.Component {
427
427
selectedNoteKeys . push ( uniqueKey )
428
428
429
429
if ( shiftKeyDown && hasSelectedNoteKey ) {
430
- const firstSelectedNoteIndex =
431
- Math . max ( this . getNoteIndexByKey ( selectedNoteKeys [ 0 ] ) ,
432
- this . state . firstShiftSelectedNoteIndex )
430
+ const firstSelectedNoteIndex = selectedNoteKeys [ 0 ] > this . state . firstShiftSelectedNoteIndex
431
+ ? selectedNoteKeys [ 0 ] : this . state . firstShiftSelectedNoteIndex
433
432
const lastSelectedNoteIndex = this . getNoteIndexByKey ( uniqueKey )
434
- const startIndex = Math . min ( firstSelectedNoteIndex , lastSelectedNoteIndex )
435
- const endIndex = Math . max ( firstSelectedNoteIndex , lastSelectedNoteIndex )
433
+ const startIndex = firstSelectedNoteIndex < lastSelectedNoteIndex
434
+ ? firstSelectedNoteIndex : lastSelectedNoteIndex
435
+ const endIndex = firstSelectedNoteIndex > lastSelectedNoteIndex
436
+ ? firstSelectedNoteIndex : lastSelectedNoteIndex
437
+
436
438
selectedNoteKeys = [ ]
437
439
for ( let i = startIndex ; i <= endIndex ; i ++ ) {
438
440
selectedNoteKeys . push ( this . notes [ i ] . key )
You can’t perform that action at this time.
0 commit comments