#event.preventDefault() is not working for onChange event
4 messages · Page 1 of 1 (latest)
4 messages · Page 1 of 1 (latest)
You are probably using a form and a button, and the button type is not defined. The button type is default to "submit", so when you press enter, you submit the form and it refreshes your page.
You can either define an submit handler on your form, or change the type of the button to "button".