From 12f0693bfd4ba15101ad8ed1e415f851d7e5321c Mon Sep 17 00:00:00 2001 From: Shallowmallow Date: Wed, 27 Nov 2024 10:01:42 +0100 Subject: [PATCH] Options Property can now be set to null --- haxe/ui/containers/properties/PropertyEditor.hx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/haxe/ui/containers/properties/PropertyEditor.hx b/haxe/ui/containers/properties/PropertyEditor.hx index 127de2ef9..b627985ba 100644 --- a/haxe/ui/containers/properties/PropertyEditor.hx +++ b/haxe/ui/containers/properties/PropertyEditor.hx @@ -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;