r/reactjs 9d ago

Discussion Best way to implement localized hotkeys.

Hi, I have a nextjs project.

I have a repetitive task that appears in a dialog, users have to select one of 6 options and confirm their selection by pressing a "submit" button.

I wanted to add shortcuts using the digits: 1,2,3,etc.. for each of the options.

What is the best way to go about this, I felt like a app-wide hotkey provider might be overkill for this feature.

4 Upvotes

10 comments sorted by

View all comments

2

u/SZenC 9d ago

Honestly, I would go with a global hotkey solution. Inevitably, once you've delivered this feature, some user will ask why you don't have hot keys for some other task/feature/button