You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pi...@apache.org on 2022/02/08 12:21:20 UTC

[royale-asjs] branch develop updated: MxRoyale: Make sure to have similar behavior with Flex when value selection of is same as current one

This is an automated email from the ASF dual-hosted git repository.

piotrz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5eafdec  MxRoyale: Make sure to have similar behavior with Flex when value selection of is same as current one
5eafdec is described below

commit 5eafdec092c5cbad4d9e820b08221285d8148394
Author: Piotr Zarzycki <pi...@gmail.com>
AuthorDate: Tue Feb 8 13:21:11 2022 +0100

    MxRoyale: Make sure to have similar behavior with Flex when value selection of is same as current one
---
 .../MXRoyale/src/main/royale/mx/controls/RadioButton.as   | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as
index 2d65f17..044224a 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as
@@ -319,14 +319,17 @@ public class RadioButton extends Button
      */
     override public function set selected(value:Boolean):void
     {
-        super.selected = value;
-        COMPILE::JS
+        if (this.selected != value)
         {
-            (rbicon.element as HTMLInputElement).checked = value;
+            super.selected = value;
+            COMPILE::JS
+            {
+                (rbicon.element as HTMLInputElement).checked = value;
+            }
+            if (group != null)
+                group.setSelection(this, false);
+            dispatchEvent(new Event("selectedChanged"));
         }
-        if (group != null)
-            group.setSelection(this, false);
-        dispatchEvent(new Event("selectedChanged"));
     }    
     
     //--------------------------------------------------------------------------