Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: Fix keyboard navigation with scroll_to_article_header=0 #1473

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions client/js/templates/EntriesPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,7 @@ export default class StateHolder extends React.Component {

// automark as read
const entry = this.state.entries.find((entry) => id === entry.id);
const autoMarkAsRead = selfoss.isAllowedToWrite() && this.props.configuration.autoMarkAsRead && entry.unread == 1;
if (autoMarkAsRead) {
if (selfoss.isAllowedToWrite() && this.props.configuration.autoMarkAsRead && entry.unread == 1) {
this.markEntryRead(id, true);
}
}
Expand Down Expand Up @@ -995,13 +994,15 @@ export default class StateHolder extends React.Component {
this.setSelectedEntry(current);
}

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

// scroll to element
autoScroll(currentElement);
// scroll to element
autoScroll(currentElement);

// focus the title link for better keyboard navigation
currentElement.querySelector('.entry-title-link').focus();
// focus the title link for better keyboard navigation
currentElement.querySelector('.entry-title-link').focus();
});
}
}

Expand Down