fixes an issue when the text is too long
when clearing the clipboard, hide it afterwards