Fix behavior of click when some text is selected