Fixes the bug of selection text in textarea.