[NUI] Prevent to call button up event when button is not pressed
authorTaehyub Kim <taehyub.kim@samsung.com>
Tue, 8 Mar 2022 13:07:20 +0000 (22:07 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Tue, 8 Mar 2022 13:23:15 +0000 (22:23 +0900)
src/Tizen.NUI.Components/Controls/Button.Internal.cs

index 178f572..2100ee1 100644 (file)
@@ -157,7 +157,10 @@ namespace Tizen.NUI.Components
                     return true;
                 case PointStateType.Up:
                     {
-                        bool clicked = isPressed && IsEnabled;
+                        if (!isPressed)
+                        {
+                            return true;
+                        }
 
                         isPressed = false;
 
@@ -172,11 +175,8 @@ namespace Tizen.NUI.Components
                             UpdateState();
                         }
 
-                        if (clicked)
-                        {
-                            ClickedEventArgs eventArgs = new ClickedEventArgs();
-                            OnClickedInternal(eventArgs);
-                        }
+                        ClickedEventArgs eventArgs = new ClickedEventArgs();
+                        OnClickedInternal(eventArgs);
 
                         return true;
                     }