I'm struggling with figuring out how to make the Enter key reference a specific button instead of the default Submit button. Let me break down the code structure for better understanding.
Inside a file called v1 (parent component), there are multiple other components like v2 and v3.
The form below is located in the v1 component
<form onsubmit={this.click}>
<v2/> <-- This component contains a grid where users can search info with a search button
<v3/>
<button>Submit</button>
</form>
What I aim to achieve is for the Enter key to reference the search button instead of the submit button every time it's pressed. I've tried using refs on the button based on my Google searches, but unfortunately, it didn't work. Also, I'm working with devextreme and React.
Thank you!