Fix SetPrimaryCursorPosition() behaviour when no focus 37/260837/8
authorBowon Ryu <bowon.ryu@samsung.com>
Mon, 5 Jul 2021 11:12:31 +0000 (20:12 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Thu, 5 Aug 2021 04:42:31 +0000 (13:42 +0900)
commit924b0441302cfe73dbb2b2a991017be4826e2b2b
treedfcfda69fa991b324ca30311a6bc53446dfa9285
parent44009aa0dc79d54f7dcd484428e3248c98d9c56c
Fix SetPrimaryCursorPosition() behaviour when no focus

If TextField does SetPrimaryCursorPosition() before CONNECTED_TO_SCENE,
there is an issue that the caret renders regardless of focus.

Also, SetPrimaryCursorPosition() always sets focus to the Text Control regardless of the user's intent.
This creates unintended bugs in the app.

This patch only updates the value of PrimaryCursorPosition when there is no focus.
When there is focus, the behaviour is the same.

Change-Id: I2bc5851c36e2c08976e7ca4656bfe38f6afe0653
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h