I have a simple html text input field within a panel on top of an OpenLayers Map. Everytime I click in the input field, the click event gets propageted to the map. I want the click event not to be propagated to the map when it is within the input field. How can I achieve this?
This is the expected behaviour and it's called Event Bubbling. I'd recommend you to check this Bubbling and capturing tutorial for a better understanding.
Anyway, sometimes it's useful to avoid it and you can achieve this by calling:
inside your event handler function.