-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix(article-detail): adjust page up/down scroll height for floating toolbar #4491
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/views/ArticleDetail/index.tsx
Outdated
const remInPixels = parseFloat( | ||
getComputedStyle(document.documentElement).fontSize | ||
) | ||
const scrollDirection = event.code.toLowerCase() === 'pagedown' ? 1 : -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space
should be 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call! just updated along with the keyValue
enum
src/views/ArticleDetail/index.tsx
Outdated
// offsetting it with the height of floating toolbar | ||
useNativeEventListener('keydown', (event: KeyboardEvent) => { | ||
if ( | ||
event.code.toLowerCase() === 'pagedown' || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a key code mapping at src/common/enums/keyValue.ts
526ba43
to
286b0eb
Compare
286b0eb
to
f4acef8
Compare
Since the presence of a floating toolbar, the normal scroll height for page up/down (fn + up/down key on OSX) hides some pixels. Now it will offset the height by the height of the toolbar
close: #4370