Fix for cursor moving for a text component only.
(cherry picked from commit b320c43)