From c77c595b92d6c39b65515910480db935ab960a0c Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Wed, 25 Aug 2021 20:12:04 +0900 Subject: [PATCH] fix wrong behaviour of SelectNone() 1. It is wrong behaviour for the cursor position to be 0 when selection is canceled. Keeping the previous cursor position is the proper behavior. 2. SelectNone() only works if selection is enabled. In this case, if selection is canceled, EDITING state is more appropriate than INACTIVE. In INACTIVE, it is difficult to continue editing work, such as the cursor being deactivated. Change-Id: I0f5f678b3ea205bc334ca9d5cd6e7626f37d8d87 Signed-off-by: Bowon Ryu --- dali-toolkit/internal/text/text-controller-impl-event-handler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dali-toolkit/internal/text/text-controller-impl-event-handler.cpp b/dali-toolkit/internal/text/text-controller-impl-event-handler.cpp index e24e8aa..d9fedd7 100644 --- a/dali-toolkit/internal/text/text-controller-impl-event-handler.cpp +++ b/dali-toolkit/internal/text/text-controller-impl-event-handler.cpp @@ -708,12 +708,11 @@ void ControllerImplEventHandler::OnSelectNoneEvent(Controller::Impl& impl) EventData& eventData = *impl.mEventData; if(eventData.mSelectionEnabled && eventData.mState == EventData::SELECTING) { - eventData.mPrimaryCursorPosition = 0u; uint32_t oldStart = eventData.mLeftSelectionPosition; uint32_t oldEnd = eventData.mRightSelectionPosition; eventData.mLeftSelectionPosition = eventData.mRightSelectionPosition = eventData.mPrimaryCursorPosition; - impl.ChangeState(EventData::INACTIVE); + impl.ChangeState(EventData::EDITING); eventData.mUpdateCursorPosition = true; eventData.mUpdateInputStyle = true; eventData.mScrollAfterUpdatePosition = true; -- 2.7.4