Skip to content

Commit

Permalink
Merge pull request #632 from devezas/master
Browse files Browse the repository at this point in the history
change to the Switch class to extend InteractiveComponent and disable focus on the Switch button
  • Loading branch information
ianharrigan authored Sep 22, 2024
2 parents 793bc4e + 86f99f8 commit e6878c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion haxe/ui/components/Switch.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import haxe.ui.util.Variant;
* A switch component that can be used to toggle between two states.
*/
@:composite(Builder, HorizontalLayout)
class Switch extends Component implements IValueComponent implements ICompositeInteractiveComponent {
class Switch extends InteractiveComponent implements IValueComponent implements ICompositeInteractiveComponent {
//***********************************************************************************************************
// Public API
//***********************************************************************************************************
Expand Down Expand Up @@ -101,6 +101,7 @@ private class Builder extends CompositeBuilder {
public override function create() {
if (_button == null) {
_button = new SwitchButtonSub();
_button.allowFocus = false;
_button.onChange = function(e) {
_switch.selected = _button.selected;
_switch.dispatch(new UIEvent(UIEvent.CHANGE));
Expand Down

0 comments on commit e6878c4

Please sign in to comment.