Fix bug when copying from a text input field.