This repository was archived by the owner on May 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
angular_components/lib/material_select Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ import 'package:angular_components/model/selection/selection_options.dart';
1111
1212/// Handles toggling selection of a range of options when shift is held down
1313/// while clicking on the end value.
14- abstract class ShiftClickSelectionMixin <T > implements ActivationHandler <T > {
14+ //
15+ // This class must support handling the deselect item as well as normal items,
16+ // so it cannot implement [ActivationHandler<T>].
17+ abstract class ShiftClickSelectionMixin <T >
18+ implements ActivationHandler <dynamic /* T | String */ > {
1519 T _pivot;
1620
1721 SelectionModel <T > get selection;
@@ -48,9 +52,11 @@ abstract class ShiftClickSelectionMixin<T> implements ActivationHandler<T> {
4852 /// If [event] is not a [MouseEvent] it will not be handled. This method
4953 /// does handle mouse events even if shift is not held down.
5054 @override
51- bool handle (UIEvent event, T activatedValue) {
55+ bool handle (UIEvent event, dynamic activatedValue) {
5256 if (selection is ! MultiSelectionModel || event is ! MouseEvent ) return false ;
53- _handleClick (event, activatedValue);
57+ // The deselect label is never shown with a MultiSelectionModel, so it's
58+ // safe to assume activatedValue is of type T at this point.
59+ _handleClick (event, activatedValue as T );
5460 return true ;
5561 }
5662}
You can’t perform that action at this time.
0 commit comments