Improve initial text selection handling