Add preventDefault for click events (fixes #1771)