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 search bar sitting on top of the header #208

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

DanWebb
Copy link
Member

@DanWebb DanWebb commented Jul 23, 2024

The layout has 3 slots: header, main and aside. The search bar is a sticky element that sits inside of main, the tab nav also works this way.

The problem with it being inside main is that when the tip in the aside is tall enough to fill up the screen it pushes main out of view, so the search bar stops scrolling at the bottom of the container and has to move up off the screen with it.

This "fix" layers the header on top of the search bar so the search bar will still scroll off the screen in some scenarios, but it won't sit on top of the header whilst it's doing so which stops it looking broken.

I think this is a viable fix because there are limited scenarios where the main would run out of space – only on mobile when the tip is taller than usual so it fills the screen. Users have to scroll right to the bottom and can see the search moving out of view as they scroll so it should be intuitive to scroll up to reveal it again.

I have played with an extra "context" slot that sits below the header, I think that would be the solution if this fix does cause issues in the future, but I struggled to get the context area scrolling correctly and found it'd be quite a big refactor to get it working so I'm happy with the easy fix for now.

@DanWebb DanWebb self-assigned this Jul 23, 2024
Copy link

sonarcloud bot commented Jul 23, 2024

@mergify mergify bot requested review from Carl-J-M and ella-etch July 23, 2024 17:12
Copy link

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ CSS stylelint 2 0 1.15s
✅ EDITORCONFIG editorconfig-checker 2 0 0.01s
✅ REPOSITORY checkov yes no 19.52s
⚠️ REPOSITORY gitleaks yes 6 2.07s
✅ REPOSITORY git_diff yes no 0.02s
✅ REPOSITORY secretlint yes no 1.63s
✅ REPOSITORY trivy-sbom yes no 2.4s
✅ REPOSITORY trufflehog yes no 33.44s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@mergify mergify bot merged commit c0cbb74 into main Jul 23, 2024
7 checks passed
@mergify mergify bot deleted the feature/wrap-784-search-bar-can-move-out-of-place branch July 23, 2024 17:34
@DanWebb
Copy link
Member Author

DanWebb commented Jul 23, 2024

🎉 This PR is included in version 1.51.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants