mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
scroll only if the entry doesn't entirely fit on screen (same as commafeed v1)
This commit is contained in:
@@ -52,8 +52,7 @@ export function FeedEntries() {
|
||||
if (selectedEntry) {
|
||||
if (selectedEntry.expanded) {
|
||||
const ref = refs.current[selectedEntry.id]
|
||||
const bottomVisible = ref.getBoundingClientRect().bottom <= window.innerHeight
|
||||
if (bottomVisible) {
|
||||
if (Constants.layout.isBottomVisible(ref)) {
|
||||
dispatch(selectNextEntry())
|
||||
} else {
|
||||
const scrollArea = document.getElementById(Constants.dom.mainScrollAreaId)
|
||||
@@ -73,8 +72,7 @@ export function FeedEntries() {
|
||||
if (selectedEntry) {
|
||||
if (selectedEntry.expanded) {
|
||||
const ref = refs.current[selectedEntry.id]
|
||||
const topVisible = ref.getBoundingClientRect().top >= Constants.layout.headerHeight
|
||||
if (topVisible) {
|
||||
if (Constants.layout.isTopVisible(ref)) {
|
||||
dispatch(selectPreviousEntry())
|
||||
} else {
|
||||
const scrollArea = document.getElementById(Constants.dom.mainScrollAreaId)
|
||||
|
||||
Reference in New Issue
Block a user