I have a modal in my screen, which has an input box. What i want is when user presses "return" or "done" button in ios keypad , i want my input to go an redux action, so what i am doing is
<input
type="text"
placeholder="Type a message"
onChange={e => setMessage(e)}
onKeyDown={e => keyDown(e)}
value={inputText}
/>
then
const keyDown = e => {
if (e.keyCode == 13) {
dispatch(userResponseChat(inputText));
setInputText("");
}
};
so for now it works well on android keypad and ios keypad when we press "return" button, but is there any way i could trigger the same when user click on "done" button in reactjs?