Fix for long press.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.cpp
index ef10a3f..f9979df 100644 (file)
@@ -1256,7 +1256,7 @@ void Controller::KeyboardFocusLostEvent()
     {
       mImpl->ChangeState( EventData::INACTIVE );
 
-      if( mImpl->IsShowingPlaceholderText() )
+      if( !mImpl->IsShowingRealText() )
       {
         // Revert to regular placeholder-text when not editing
         ShowPlaceholderText();
@@ -1523,6 +1523,11 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y )
       else if( EventData::EDITING                  != mImpl->mEventData->mState &&
                EventData::EDITING_WITH_GRAB_HANDLE != mImpl->mEventData->mState )
       {
+        if( mImpl->IsShowingPlaceholderText() &&  ! mImpl->IsFocusedPlaceholderAvailable() )
+        {
+          // Hide placeholder text
+          ResetText();
+        }
         // Show cursor on first tap
         mImpl->ChangeState( EventData::EDITING );
         relayoutNeeded = true;
@@ -1606,6 +1611,9 @@ void Controller::LongPressEvent( Gesture::State state, float x, float y  )
       }
       else
       {
+        // Reset the imf manger to commit the pre-edit before selecting the text.
+        mImpl->ResetImfManager();
+
         SelectEvent( x, y, false );
       }
     }