This issue likely happens due to how the browser handles event propagation and default actions when interacting with form elements like inputs. When you select text and keep clicking, the input element may be capturing the click event and preventing it from reaching other elements on the page, which can affect the click event listener on the page.
To fix this, you can try using event.stopPropagation() or event.preventDefault() inside your input event handler to manage event bubbling and ensure the page's click events still trigger. Alternatively, you can consider adjusting how the input handles the interaction with the click events.