[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / toggle-button-impl.cpp
index deab292..1479e35 100644 (file)
@@ -412,10 +412,10 @@ Property::Index ToggleButton::ToggleButtonAccessible::GetDescriptionPropertyInde
 void ToggleButton::OnStateChange(State newState)
 {
   // TODO: replace it with OnPropertySet hook once Button::Property::SELECTED will be consistently used
-  if((Self() == Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor()) && (newState == SELECTED_STATE || newState == UNSELECTED_STATE))
+  if(newState == SELECTED_STATE || newState == UNSELECTED_STATE)
   {
     auto* accessible = GetAccessibleObject();
-    if(DALI_LIKELY(accessible))
+    if(DALI_LIKELY(accessible) && accessible->IsHighlighted())
     {
       accessible->EmitStateChanged(Dali::Accessibility::State::CHECKED, mCurrentToggleIndex ? 1 : 0, 0);
       accessible->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION);