Add preventDefault on button clicks (fixes #1551)