I have a basic input and tags: https://codepen.io/agrawalishaan/pen/QWBxBdK
span { border: 1px solid red; }
<label for="myInput"> I am a label! <span>icon</span> </label> <input id="myInput"/>
When I click on the label, the cursor is set inside the input, which is ideal.
My tags also contain an information icon. When I hover over the icon, a popup appears (so I need hover
for it to work).
On mobile devices, instead of hovering, a click is required. However, when I click on this icon, a popup appears and the input is selected, how can I specifically disable the input selection when only clicking on the icon?
I added some JavaScript using the event.preventDefault() method to ensure that the input does not get focus when the icon is clicked.