Skip to content

SearchField does not submit when hitting ENTER #5774

Answered by LFDanLu
janvorwerk asked this question in Q&A
Discussion options

You must be logged in to vote

Ah, that would because of this:

if (key === 'Enter') {
e.preventDefault();
}
if (isDisabled || isReadOnly) {
return;
}
if (key === 'Enter') {
onSubmit(state.value);
. Its been a while since I touched that code, but I think we did it like that because we felt that typically users would want to trigger a search operation rather than submit a form when hitting enter.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@janvorwerk
Comment options

@QzCurious
Comment options

Answer selected by janvorwerk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants