shadcn_flutter icon indicating copy to clipboard operation
shadcn_flutter copied to clipboard

Add ScrollInterCeptionBehavior for toggling autoscroll

Open nz366 opened this issue 1 month ago • 4 comments

Summary

Briefly describe what this PR changes and why.

  • Motivation / Context: With current implementation scroll interceptor does not work with trackpads. So chrome like auto-scroll was added.

Type of change

  • [ ] fix: Bug fix (non-breaking change)
  • [x] feat: New feature / new component
  • [ ] perf: Performance improvement
  • [ ] refactor/chore: Code refactor or tooling update
  • [ ] docs: Documentation only
  • [ ] build/devtools: Generators, scripts, or infra changes

Scope (check all that apply)

  • [x] Components (lib/src/components/...)
  • [ ] Utilities (lib/src/util.dart, animation/collection, platform)
  • [ ] Icons / Fonts (icons/, lib/icons/, pubspec fonts)
  • [ ] Theme / Colors (lib/src/theme/, colors/ + style transpilers)
  • [x] Docs app (docs/)
  • [ ] Generators / Tools (gen/bin/)
  • [ ] Example app (example/)
  • [ ] Tests (example/test/, test_widget/)
  • [ ] CI / Workflows

Linked issues

Closes # Refs #

Screenshots / Videos (if UI)

Include light/dark and relevant states.

Breaking changes

  • [ ] Yes (add migration notes below)
  • [x] No

How I tested

  • Manual verification in docs app (Chrome)

Checklist

Please ensure the following are complete before requesting review. See CONTRIBUTING.md for details.

  • [x] Code formatted (dart format .)
  • [x] Analyzer passes (flutter analyze)
  • [ ] Tests added/updated and passing (flutter test where applicable)
  • [ ] Public API documented (public_member_api_docs)
  • [ ] Docs/examples updated (docs pages or README images)
  • [ ] Exports updated in lib/shadcn_flutter.dart (for new public widgets)
  • [ ] A11y validated in docs (run_docs_web_semantics.bat)
  • [ ] Generators run when relevant:
    • [ ] LLMs / Guides (gen_dotguides.bat)
  • [ ] CHANGELOG updated (if user-visible change)

Additional notes

nz366 avatar Nov 11 '25 16:11 nz366

Turns out chrome supports both drag scrolling and tap scrolling. Should I remove the Behavior class then or add extra configuration?

nz366 avatar Nov 20 '25 04:11 nz366

Turns out chrome supports both drag scrolling and tap scrolling. Should I remove the Behavior class then or add extra configuration?

Whats the extra configuration?

sunarya-thito avatar Nov 22 '25 21:11 sunarya-thito

Turns out chrome supports both drag scrolling and tap scrolling. Should I remove the Behavior class then or add extra configuration?

Whats the extra configuration?

switch between hold or tap scrolling (current) final bool holdDrag; extra config that enables combined hold drag + move / tap release to activate scrolling (default chrome behavior)

final bool holdDragOrTap;

Could be a new Enum

or just remove behavior class so when enabled it works in that holdDragOrTap combined interaction.

nz366 avatar Nov 23 '25 11:11 nz366

I couldn't picture what youre describing, try it out, ill leave feedback later.

sunarya-thito avatar Nov 24 '25 19:11 sunarya-thito