Skip to content

getting blank input value on keydown event in fluent ui seachbox #28427

Answered by behowell
sagarkalokhe09 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @sagarkalokhe09, is this the v8 SearchBox? https://developer.microsoft.com/en-us/fluentui#/controls/web/searchbox

The onKeyDown event happens before the value is updated. Consider using the onChange event instead. That also has a second parameter, which is the new value. See the documentation on the link above.

<SearchBox onChange={(_ev, value) => console.log(value)} />

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ZzyzxIsAlreadyTaken
Comment options

Answer selected by behowell
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