• Ian Hickson's avatar
    Allow long-press gestures to continue even if buttons change. (#127877) · bc49cd1b
    Ian Hickson authored
    Previously, if you changed buttons during a long-press gesture, if it was before the gesture was accepted we would discard it, and if it was after the gesture was accepted we would silently end it without firing any of the relevant events.
    
    This silent cancelation behavior is terrible because it means there's no way for consumers to know what state they're in, so you end up with widgets that thing they're still being long-pressed even though nothing is happening.
    
    We could change the behavior in three ways, as far as I can tell:
    
    - we could send a cancel event when you change buttons. This would introduce a new kind of transition (start->cancel) which I don't think we currently require people to support. This would therefore not fix existing code and would make future code more complicated to handle a really obscure user action that it seems unlikely anyone cares about.
    
    - we could send an end event when you change buttons. This would mean the action commits, even though the user is still holding the mouse button down. This seems slightly better than the previous option but still not ideal as it means nudging the mouse button commits you even though you're still holding the button down.
    
    - we could ignore button changes after the long-press has been accepted.
    
    I implemented the last one in this PR.
    bc49cd1b
Name
Last commit
Last update
..
arena.dart Loading commit data...
binding.dart Loading commit data...
constants.dart Loading commit data...
converter.dart Loading commit data...
debug.dart Loading commit data...
drag.dart Loading commit data...
drag_details.dart Loading commit data...
eager.dart Loading commit data...
events.dart Loading commit data...
force_press.dart Loading commit data...
gesture_settings.dart Loading commit data...
hit_test.dart Loading commit data...
long_press.dart Loading commit data...
lsq_solver.dart Loading commit data...
monodrag.dart Loading commit data...
multidrag.dart Loading commit data...
multitap.dart Loading commit data...
pointer_router.dart Loading commit data...
pointer_signal_resolver.dart Loading commit data...
recognizer.dart Loading commit data...
resampler.dart Loading commit data...
scale.dart Loading commit data...
tap.dart Loading commit data...
team.dart Loading commit data...
velocity_tracker.dart Loading commit data...