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

fix: set scrolled attribute only when offset is larger than the header #2133

Merged
merged 2 commits into from
Sep 22, 2023

Conversation

felix-ico
Copy link
Collaborator

@felix-ico felix-ico commented Sep 20, 2023

fix for #2130

@netlify
Copy link

netlify bot commented Sep 20, 2023

Deploy Preview for marvelous-moxie-a6e2fe ready!

Name Link
🔨 Latest commit 0b0c9c3
🔍 Latest deploy log https://app.netlify.com/sites/marvelous-moxie-a6e2fe/deploys/650c703a65ccc90008781690
😎 Deploy Preview https://deploy-preview-2133--marvelous-moxie-a6e2fe.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -47,7 +47,7 @@ export class TelekomHeader {

@Listen('scroll', { target: 'document' })
onScroll() {
this.scrolled = window.pageYOffset > 2;
this.scrolled = window.pageYOffset > 48;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer this 48 not be hard-coded, but calculated… if not possible (or too complex), at least add a comment explaining where the number is coming from 🤓

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought about calculating it here but it seemed rather overkill for this. Only issue i see with this now, is that on medium viewport the header is not 48px but a little bit smaller - IMO not a problem, it would just minimize when scrolling 10px more than the header height at that viewport size. (or was it requested by UX/UI that the header minimizes ASAP? )

@felix-ico felix-ico merged commit df45405 into main Sep 22, 2023
11 checks passed
@felix-ico felix-ico deleted the fix/header-scroll-behavior branch September 22, 2023 08:34
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.

2 participants