studiosnack / brews-clues

Have you seen my brew?
0 stars 0 forks source link

Set to Today #28

Closed chiaberry closed 7 years ago

chiaberry commented 7 years ago

Button added to set to today.

Currently I don’t initialize anything in state besides the page, so you are saying to fix this warning, I need to set a default value?

chiaberry commented 7 years ago

Another question: when do I have to event.preventDefault()? Always? Never?

nsfmc commented 7 years ago

Only when the event has a default action that you are trying to prevent. I.e. Calling preventdefault on an input will keep a letter from appearing but will still register the keydown event which has access to the key which was pressed.

Similarly with a form, if the form event is not prevented the page will attempt to navigate to the form action location.

Most events do not need to be prevented