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

FE Refinement (8 / ∞): html and body overflow settings + reactive app top bar to scrollbar #266

Closed
wants to merge 34 commits into from

Conversation

cloudyyoung
Copy link
Member

This PR fixes a list of niche things in order to develop the Dialog in #252 next.

Background

Current implementation only supports it to be fixed relative to the whole window. The reactive part of the AppTopBar monitors the value of window.scrollTop and decides its rendering. However, the AppTopBar needs to be a "fixed" element relative to arbitrary container, eg, fixed at the top within in a Dialog. So its scrolling monitoring mechanism must be able to monitor an arbitrary container rather than only window.

Because of the rubber band scrolling effect in all Apple systems. On touch screens, if html contains another scrollable div, the scrollable div sometimes freezes because the gesture is conflicting to scroll the entire html and thus freezes the scrollable div.

rpreplay-final1679743484_Yw64vGx9.mp4

Changes

  1. Add overflow-hidden to html, tells browser that html is not scrollable so when gestures is scrolling something, it must not be html!
  2. Make body scrollable because something must be scrollable...
  3. The previous two points only applies on touch screens, it behaves the same as before when it's not touch screen
  4. AppTopBar scrolling mechanism now monitors both window.scrollTop and the scroll position of an arbitrary container containerRef, whichever has value provided, so it works with both with or without a container provided

It also fixes the behaviour of ATB unintentionally and it's lovely:

Screen.Recording.2023-03-25.at.6.01.48.AM.mov
Screen.Recording.2023-03-25.at.6.02.45.AM.mov

@cloudyyoung
Copy link
Member Author

This needs more work...

@cloudyyoung cloudyyoung reopened this Mar 28, 2023
@cloudyyoung cloudyyoung deleted the yunfan/fix-html-overflow branch March 28, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant