mirror of
https://github.com/immich-app/immich.git
synced 2026-03-04 16:03:46 -05:00
fix(mobile): infer drag intent early (#26344)
The drag intent was not set until it reached the kTouchSlop threshold. This is not necessary as flutter already has its own heuristics for preventing unintended drags. The result of using kTouchSlop is that dismissing or scroll can feel a little delayed, and will jump from 0 to kTouchSlop (18px) rather than moving smoothly.
This commit is contained in:
parent
db4e7abf6d
commit
0fa385c465
@ -143,8 +143,8 @@ class _AssetPageState extends ConsumerState<AssetPage> {
|
||||
|
||||
if (_dragIntent == _DragIntent.none) {
|
||||
_dragIntent = switch ((details.globalPosition - _dragStart!.globalPosition).dy) {
|
||||
< -kTouchSlop => _DragIntent.scroll,
|
||||
> kTouchSlop => _DragIntent.dismiss,
|
||||
< 0 => _DragIntent.scroll,
|
||||
> 0 => _DragIntent.dismiss,
|
||||
_ => _DragIntent.none,
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user