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: remove drawerEdgeDragWidth property #674

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Udhay-Adithya
Copy link
Contributor

PR Description

The issue occurred because drawerEdgeDragWidth was set to context.width(entire screen width), causing the entire screen width to act as the drawer drag area. This prevented horizontal scrolling from working properly.

Fix: Removed drawerEdgeDragWidth: context.width, which restored the expected horizontal scroll behavior while keeping the drawer functional.

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

  • Yes
  • No, and this is why: They are already present for this specific widget which is modified.

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

@badnikhil
Copy link
Contributor

badnikhil commented Mar 19, 2025

it doesn't fix the issue.. Check again..
Test it for android
Screencast from 2025-03-19 07-28-09.webm

@Udhay-Adithya
Copy link
Contributor Author

it doesn't fix the issue.. Check again.. Test it for android Screencast from 2025-03-19 07-28-09.webm

Thanks for letting me know about this, i found why this doesn't work with Android.

When displaying a single line of code in the CodeGenPreviewer, horizontal scrolling was only possible when we directly interact with the text. So, any empty space below the text did not respond to horizontal drag gestures. This is because
the SingleChildScrollView responsible for horizontal scrolling was placed inside another SingleChildScrollView for vertical scrolling. Since the inner scroll view controlled horizontal scrolling, users could only scroll when directly interacting with the text itself, not the surrounding empty area. So

Swapped the controllers so that the parent scrolls horizontally and the child scrolls vertically. This ensures that horizontal scrolling is always possible, even when dragging in the empty space below a single-line code block.

@badnikhil
Copy link
Contributor

badnikhil commented Mar 20, 2025

Before diving deeper into this issue, I think it’s best to wait for a mentor to review the bug/behavior. Also, if you’re making changes, please ensure they are properly tested first.

@DenserMeerkat
Copy link
Contributor

DenserMeerkat commented Mar 23, 2025

This solution resolves scrolling problems on Mobile (I verified on Android).

However in desktop it negatively impacts the accessibility by hiding the vertical scrollbar to the right and not showing the horizontal scrollbar.

code-pane-scroll-issue.mp4

@badnikhil
Copy link
Contributor

This solution resolves scrolling problems on Mobile (I verified on Android).

However in desktop it negatively impacts the accessibility by hiding the vertical scrollbar to the right and not showing the horizontal scrollbar.

code-pane-scroll-issue.mp4

Set the draweredgewidth to zero(everything works well).. it currently covers the whole width of screen.. we can give half or one third of contextwidth to drawer .. or an Alternative solution is expected ?

@DenserMeerkat
Copy link
Contributor

DenserMeerkat commented Mar 23, 2025

Set the draweredgewidth to zero(everything works well).. it currently covers the whole width of screen.. we can give half or one third of contextwidth to drawer .. or an Alternative solution is expected ?

@badnikhil I've added my comments in the issue thread.

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.

Horizontal scroll not working in CodePane
3 participants