Skip to content

Commit

Permalink
Options Property can now be set to null
Browse files Browse the repository at this point in the history
  • Loading branch information
Shallowmallow committed Nov 27, 2024
1 parent 2bad9ae commit 12f0693
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion haxe/ui/containers/properties/PropertyEditor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,17 @@ class PropertyEditorOptions extends PropertyEditor {

@:bind(buttonBar, UIEvent.CHANGE)
private function onButtonBarChange(_) {
onValueChanged(buttonBar.selectedButton.text);
if (buttonBar.selectedButton != null) {
onValueChanged(buttonBar.selectedButton.text);
} else {
onValueChanged(null);
}
}

public override function applyValue(value:Variant) {
if (value == null) {
buttonBar.selectedIndex = -1;
}
for (button in buttonBar.findComponents(Button)) {
if (button.text == value.toString() || button.id == value.toString()) {
button.selected = true;
Expand Down

0 comments on commit 12f0693

Please sign in to comment.