Skip to content

Commit 0e59b31

Browse files
committed
Fix keyboard navigation with scroll_to_article_header=0
1 parent e0c9805 commit 0e59b31

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

client/js/templates/EntriesPage.jsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,7 @@ export default class StateHolder extends React.Component {
598598

599599
// automark as read
600600
const entry = this.state.entries.find((entry) => id === entry.id);
601-
const autoMarkAsRead = selfoss.isAllowedToWrite() && this.props.configuration.autoMarkAsRead && entry.unread == 1;
602-
if (autoMarkAsRead) {
601+
if (selfoss.isAllowedToWrite() && this.props.configuration.autoMarkAsRead && entry.unread == 1) {
603602
this.markEntryRead(id, true);
604603
}
605604
}
@@ -995,13 +994,15 @@ export default class StateHolder extends React.Component {
995994
this.setSelectedEntry(current);
996995
}
997996

998-
const currentElement = document.querySelector(`.entry[data-entry-id="${current}"]`);
997+
window.requestAnimationFrame(() => {
998+
const currentElement = document.querySelector(`.entry[data-entry-id="${current}"]`);
999999

1000-
// scroll to element
1001-
autoScroll(currentElement);
1000+
// scroll to element
1001+
autoScroll(currentElement);
10021002

1003-
// focus the title link for better keyboard navigation
1004-
currentElement.querySelector('.entry-title-link').focus();
1003+
// focus the title link for better keyboard navigation
1004+
currentElement.querySelector('.entry-title-link').focus();
1005+
});
10051006
}
10061007
}
10071008

0 commit comments

Comments
 (0)