rolandtoth/FilterBox

preventDefault() for Enter key?

adrianbj opened this issue · 2 comments

For my implementation in Tracy at least, it looks a little cleaner if there is a: e.preventDefault(); after this line:

} else if (e.keyCode === keys.ENTER) {

Do you think this would be ok for all uses?

I pass the event object to allow the developer decide whether to use preventDefault(). I haven't had a need for that so far, but this way it doesn't potentially block other events on the input, if any.

Thanks - I made the change in the callback instead!