[AT-SPI] Fix EditableTextControlAccessible::InsertText()
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / common-text-utils.cpp
index e0c2306..646bdbf 100644 (file)
@@ -55,6 +55,7 @@ void CommonTextUtils::RenderText(
   float&                            alignmentOffset,
   Actor&                            renderableActor,
   Actor&                            backgroundActor,
+  Actor&                            cursorLayerActor,
   Toolkit::Control&                 stencil,
   std::vector<Actor>&               clippingDecorationActors,
   std::vector<Toolkit::TextAnchor>& anchorActors,
@@ -132,10 +133,6 @@ void CommonTextUtils::RenderText(
       {
         highlightActor = *it;
       }
-      else if(it->GetProperty<std::string>(Dali::Actor::Property::NAME) == "CursorLayerActor")
-      {
-        it->RaiseToTop();
-      }
     }
     clippingDecorationActors.clear();
 
@@ -156,6 +153,12 @@ void CommonTextUtils::RenderText(
         backgroundActor.LowerToBottom();
       }
     }
+
+    if(cursorLayerActor)
+    {
+      cursorLayerActor.RaiseToTop();
+    }
+
     SynchronizeTextAnchorsInParent(textActor, controller, anchorActors);
   }
 }
@@ -485,7 +488,7 @@ bool EditableTextControlAccessible::InsertText(std::size_t startPosition, std::s
 {
   auto text = GetWholeText();
 
-  if(!ValidateRange(text, startPosition, startPosition + 1))
+  if(!ValidateRange(text, startPosition, startPosition + 1) && !(startPosition == text.size()))
   {
     return false;
   }