From: Joogab Yun Date: Wed, 7 Nov 2018 04:18:30 +0000 (+0900) Subject: Set mScrollAfterUpdatePosition to true when you get the keyboard forcus. X-Git-Tag: dali_1.3.49~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=8a313bb71bb0d1b443e2b5d7f383155433d385e0 Set mScrollAfterUpdatePosition to true when you get the keyboard forcus. - The cursor position is not correctly displayed when The text field is focus out and then focus in. [sample] Stage stage = Dali::Stage::GetCurrent(); stage.SetBackgroundColor(Color::WHITE); stage.KeyEventSignal().Connect(this, &HelloWorldController::OnKeyEvent); test1 = TextField::New( ); test1.SetProperty( TextField::Property::TEXT,"Abcdefghijklmnopqrstuvw Abcdefghijklmnopqrstuvw Abcdefghijklmnopqrstuvw" ); test1.SetSize( 400, 50 ); test1.SetPosition(50, 80); test1.SetParentOrigin(ParentOrigin::TOP_LEFT); test1.SetAnchorPoint(AnchorPoint::TOP_LEFT); test1.SetProperty(TextField::Property::ELLIPSIS, true); test1.SetProperty( TextField::Property::TEXT_COLOR, Color::RED ); stage.Add( test1 ); test1.SetKeyboardFocusable(true); void OnKeyEvent(const KeyEvent& event) { if(event.state == KeyEvent::Down) { if(event.keyPressedName == "1") { KeyboardFocusManager::Get().SetCurrentFocusActor( test1 ); } } } Change-Id: I3e83998523107f8b64cdce891fbcd17850724df8 --- diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 5d0543c..6c1bf75 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -2429,6 +2429,7 @@ void Controller::KeyboardFocusGainEvent() mImpl->ChangeState( EventData::EDITING ); mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered. mImpl->mEventData->mUpdateInputStyle = true; + mImpl->mEventData->mScrollAfterUpdatePosition = true; } mImpl->NotifyInputMethodContextMultiLineStatus(); if( mImpl->IsShowingPlaceholderText() )