Added support for initial caret positioning when focusing for the first time.