Skip to content

Commit

Permalink
fix: copy latest item on startup. closes #54
Browse files Browse the repository at this point in the history
  • Loading branch information
oae committed Sep 11, 2022
1 parent edbd505 commit c807c87
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/panoScrollView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ export class PanoScrollView extends ScrollView {
},
);

const firstItem = this.list.get_first_child() as PanoItem;
if (firstItem) {
firstItem.emit('activated');
}

this.settings.connect('changed::history-length', () => {
this.removeExcessiveItems();
});
Expand Down Expand Up @@ -246,6 +251,14 @@ export class PanoScrollView extends ScrollView {
return true;
}
}
} else if (this.currentFilter && this.getVisibleItems().length > 0) {
this.currentFocus = this.getVisibleItems()[0];
this.currentFocus.grab_key_focus();
return true;
} else if (!this.currentFilter && this.getVisibleItems().length > 1) {
this.currentFocus = this.getVisibleItems()[1];
this.currentFocus.grab_key_focus();
return true;
} else if (this.getVisibleItems().length > 0) {
this.currentFocus = this.getVisibleItems()[0];
this.currentFocus.grab_key_focus();
Expand Down

0 comments on commit c807c87

Please sign in to comment.