XKit-Rewritten icon indicating copy to clipboard operation
XKit-Rewritten copied to clipboard

feat(Scroll to Bottom): Function in modal blog view

Open marcustyphoon opened this issue 2 years ago • 5 comments

Description

It doesn't add functionality to work in the modal blog view; that's more complicated. – #976.

This adds scroll to bottom functionality in the mobile blog view. To do so, it adds a duplicate of the round "Back to top" button that's specific to the modal blog view container, and adjusts the scrolled element and observed element in startScrolling depending upon the presence or absence of the modal.

It also replaces the checkForButtonRemoved pageModification callback with a check during the scrollToBottom function.

Testing steps

todo: write all of the tests that this stops scrolling when you would expect it to

marcustyphoon avatar Feb 16 '23 00:02 marcustyphoon

Issue with this: because the button color is now customized by the user theme (?), the button color will desync when navigating to a different blog in the modal.

  • [x] address this

marcustyphoon avatar May 25 '23 16:05 marcustyphoon

Showing both the regular scroll to top button and the blog view one at the same time is kinda weird. Let's hide the regular button when the blog view modal is open.

Oh, definitely. Not immediately sure how to do that, so if anyone has any ideas, hit me up.

Only showing the blog view scroll to bottom button when the blog view scroll to top button is visible doesn't make sense to me. Let's match the behaviour of the regular one, where it is shown regardless of scroll position.

You know, I'm not actually sure how to do that either?

marcustyphoon avatar Sep 26 '23 01:09 marcustyphoon

Note: This can probably take advantage of :has().

marcustyphoon avatar Mar 23 '24 23:03 marcustyphoon

Only showing the blog view scroll to bottom button when the blog view scroll to top button is visible doesn't make sense to me. Let's match the behaviour of the regular one, where it is shown regardless of scroll position.

Yeah, I don't think this is really possible without changing the Tumblr code's handling of the scrollToTopEnabled prop to render-but-hide the back to top button instead of conditionally rendering both it and its container.

marcustyphoon avatar Mar 26 '24 02:03 marcustyphoon