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 mobile viewer toolbars #701

Merged
merged 5 commits into from
Sep 24, 2024
Merged

Conversation

allanlasser
Copy link
Member

@allanlasser allanlasser commented Sep 23, 2024

This adds responsive logic for the viewer's search input, disclosing it inside a dropdown when on mobile. This prevents the viewer's top toolbar from overflowing the viewport at narrow screen widths.

In addition, this adds a preprocessor to modify the behavior of bind:clientWidth. The default behavior adds style="position: relative", which is undesirable for our toolbars, which rely on definite placement within the stacking context for correct menu behavior and sticky positioning. This preprocessor also uses a more performant method of binding to clientWidth by using ResizeObserver instead of iframe hackery. This might be fixed in Svelte 5.

Copy link

netlify bot commented Sep 23, 2024

Deploy Preview for documentcloud-frontend ready!

Name Link
🔨 Latest commit ebbb0a2
🔍 Latest deploy log https://app.netlify.com/sites/documentcloud-frontend/deploys/66f1bff71de39700082a05c3
😎 Deploy Preview https://deploy-preview-701.muckcloud.com
📱 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.

Copy link

github-actions bot commented Sep 23, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 23.06% 6306 / 27346
🔵 Statements 23.06% 6306 / 27346
🔵 Functions 39.87% 132 / 331
🔵 Branches 54.3% 328 / 604
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/lib/components/common/PageToolbar.svelte 0% 0% 0% 0% 1-496
src/lib/components/documents/toolbars/ReadingToolbar.svelte 0% 0% 0% 0% 1-150
src/lib/components/forms/Search.svelte 0% 0% 0% 0% 1-118
Generated in workflow #455

@eyeseast
Copy link
Contributor

Screenshot 2024-09-23 at 3 17 55 PM

Just testing this in Chrome's dev tools, I can get to a state where the dropdown is open but invisible. I put in a search and submitted, and then tried to search again and got stuck here.

@allanlasser
Copy link
Member Author

Just testing this in Chrome's dev tools, I can get to a state where the dropdown is open but invisible. I put in a search and submitted, and then tried to search again and got stuck here.

Ah, the search is set to appear above, but it's hidden by the scroll position. I'll switch it to appear below instead.

@allanlasser allanlasser merged commit 97c6b3f into sveltekit Sep 24, 2024
9 of 10 checks passed
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