Fixes the change of style when the text-field grabs the keyboard focus. 06/46606/1
authorv.cebollada <v.cebollada@samsung.com>
Mon, 24 Aug 2015 04:48:53 +0000 (13:48 +0900)
committerv.cebollada <v.cebollada@samsung.com>
Mon, 24 Aug 2015 04:59:50 +0000 (13:59 +0900)
* The text field is not in edit mode.
  - Double tap to select a word. The text-field grabs the focus but it
  shouldn't change to edit mode, it should select the word.
  - Tap to edit, tap in a different place to make the grab handle to appear.
  When the text-field grabs the focus it goes bak to edit mode and the
  grab handle dissapears.

Change-Id: I9dd055df25a8d358b0950faa76ab155affcce7cb
Signed-off-by: v.cebollada <v.cebollada@samsung.com>
dali-toolkit/internal/text/text-controller.cpp

index bce657c..2260517 100644 (file)
@@ -1098,7 +1098,12 @@ void Controller::KeyboardFocusGainEvent()
 
   if( mImpl->mEventData )
   {
-    mImpl->ChangeState( EventData::EDITING );
+    if( ( EventData::INACTIVE == mImpl->mEventData->mState ) ||
+        ( EventData::INTERRUPTED == mImpl->mEventData->mState ) )
+    {
+      mImpl->ChangeState( EventData::EDITING );
+      mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered.
+    }
 
     if( mImpl->IsShowingPlaceholderText() )
     {
@@ -1106,7 +1111,6 @@ void Controller::KeyboardFocusGainEvent()
       ShowPlaceholderText();
     }
 
-    mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered.
     mImpl->RequestRelayout();
   }
 }
@@ -1192,7 +1196,8 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
       textChanged = true;
     }
 
-    if ( mImpl->mEventData->mState != EventData::INTERRUPTED &&  mImpl->mEventData->mState != EventData::INACTIVE )
+    if ( ( mImpl->mEventData->mState != EventData::INTERRUPTED ) &&
+         ( mImpl->mEventData->mState != EventData::INACTIVE ) )
     {
       mImpl->ChangeState( EventData::EDITING );
     }