[NUI] Fix to invoke ValueChanged event when changing the value to Key
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 8 Jun 2022 05:37:59 +0000 (14:37 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 21 Jun 2022 10:27:08 +0000 (19:27 +0900)
- Until now, `ValueChanged` event emits on Touch / Mouse moving.
- Update to invoke the event when the thumb moves
 with not only touch event but also key event.

Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
src/Tizen.NUI.Components/Controls/Slider.cs

index c2c3ee7..13aea98 100755 (executable)
@@ -1435,6 +1435,7 @@ namespace Tizen.NUI.Components
                 recoverIndicator = FocusManager.Instance.FocusIndicator;
                 FocusManager.Instance.FocusIndicator = editModeIndicator;
             }
+            UpdateState(true, isPressed);
             return true;
         }
 
@@ -1466,6 +1467,9 @@ namespace Tizen.NUI.Components
                             {
                                 CurrentValue -= 1;
                             }
+                            sliderValueChangedHandler?.Invoke(this, new SliderValueChangedEventArgs {
+                                CurrentValue = curValue
+                                });
                         }
                         return true; // Consumed
                     }
@@ -1487,6 +1491,9 @@ namespace Tizen.NUI.Components
                             {
                                 CurrentValue += 1;
                             }
+                            sliderValueChangedHandler?.Invoke(this, new SliderValueChangedEventArgs {
+                                CurrentValue = curValue
+                                });
                         }
                         return true; // Consumed
                     }
@@ -1771,6 +1778,11 @@ namespace Tizen.NUI.Components
                 return false;
             }
 
+            if (this.FocusableInTouch == false && editMode == false)
+            {
+                isFocused = false;   
+            }
+
             PointStateType state = e.Touch.GetState(0);
             if (state == PointStateType.Down)
             {
@@ -1807,6 +1819,11 @@ namespace Tizen.NUI.Components
 
         private bool OnTouchEventForThumb(object source, TouchEventArgs e)
         {
+            if (this.FocusableInTouch == false && editMode == false)
+            {
+                isFocused = false;   
+            }
+
             PointStateType state = e.Touch.GetState(0);
             if (state == PointStateType.Down)
             {