Skip to content

Commit

Permalink
allow setting scrollmode=native per scrollview instance
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed May 29, 2024
1 parent ef28f5c commit 7b535e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions haxe/ui/constants/ScrollMode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ enum abstract ScrollMode(String) to String {
var DRAG = "drag";
var INERTIAL = "inertial";
var HYBRID = "hybrid";
var NATIVE = "native";

@:from public static function fromString(s:String):ScrollMode {
return switch (s.toLowerCase()) {
case "normal": NORMAL;
case "drag": DRAG;
case "inertial": INERTIAL;
case "hybrid": HYBRID;
case "native": NATIVE;
case _: throw "invalid ScrollMode enum value '" + s + "'";
}
}
Expand Down
2 changes: 2 additions & 0 deletions haxe/ui/containers/ScrollView.hx
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ private class ScrollModeBehaviour extends DataBehaviour {
public override function set(value:Variant) {
if (value == ScrollMode.HYBRID) {
_component.isHybridScroller = true;
} else if (value == ScrollMode.NATIVE) {
_component.isNativeScroller = true;
}
super.set(value);
}
Expand Down

0 comments on commit 7b535e8

Please sign in to comment.