Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(drawer): enable drawer content scroll on overflow#2235

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
braden-w wants to merge1 commit intohuntabyte:main
base:main
Choose a base branch
Loading
frombraden-w:feat/drawer-scrollable-content

Conversation

@braden-w
Copy link
Contributor

@braden-wbraden-w commentedJul 22, 2025
edited
Loading

This change enables proper vertical scrolling for drawer components when content exceeds the drawer height, inspired by@huntabyte 'simplementation in thevaul-svelte docs. Previously, drawers with long content could overflow without proper scrolling behavior, making it difficult for users to access all content and resulting in poor mobile UX.

To accomplish this, I wrapped the{@render children?.()} in a<div> container. Theflex-1 class ensures the content takes up remaining space after the drag handle at the top, whileoverflow-y-auto enables vertical scrolling.

Add scrollable wrapper div around drawer children that:- Uses flex-1 to take remaining space after the fixed drag handle- Uses overflow-y-auto to enable vertical scrolling when content exceeds drawer height- Maintains the drag handle as fixed at the top while content scrolls independentlyThis improves UX for drawers with long content by enabling proper verticalscrolling behavior without layout issues.
@changeset-bot
Copy link

⚠️ No Changeset found

Latest commit:403a467

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go.If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actionsbot commentedJul 22, 2025
edited
Loading

built withRefined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

NameStatusPreviewLast Commit
shadcn-svelte✅ Ready (View Log)Visit Preview403a467

@braden-wbraden-w changed the titlefeat(drawer): wrap drawer content in scrollable containerfeat(drawer): enable drawer content scroll on overflowJul 22, 2025
@huntabyte
Copy link
Owner

Does applying overflow-y-auto to the content not work as expected when you have overflowing content?

@braden-w
Copy link
ContributorAuthor

braden-w commentedJul 24, 2025
edited
Loading

@huntabyte Unfortunately not, I tried also tried theoverflow-auto code onto theDrawer.Content component, but it doesn't scroll properly, seems to overflow with a ton of random whitespace. You can look into the StackBlitzhere and try moving theoverflow-auto class from the div into theDrawer.Content.

Puttingoverflow-auto on the inner div:

CleanShot 2025-07-24 at 16 48 34@2x

Putting it on theDrawer.Content. Notice the extra whitespace and how it's suddenly much taller.

CleanShot 2025-07-24 at 16 49 04@2xCleanShot 2025-07-24 at 16 49 07@2x

Not sure if this is what's happening, but it seems like it's simultaneously adding a scroll bar because there's not enough space, but it also is taller, giving it more space than necessary compared to the previously computed amount of scrollthat would be needed. And so the scroll bar now has a bunch of extra white space to scroll into.

It's unclear to me if the change I propose is the best course of action, though.

  1. Should we always wrap with thediv andoverflow-y-auto?
  2. At the same time, maybe a code example in the docs would suffice so they know how to handle overflow?
  3. Maybe this is something we should fix invaul-svelte?

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@braden-w@huntabyte

[8]ページ先頭

©2009-2025 Movatter.jp