Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

reactjs - Give GroupHeader keyboard focus react-select

I have been trying to change how groups are displayed in my react-select implementation so that I can sub-menus display within the dropdown like this:

image of menu with sub-menu

Ideally when you either click or enter or spacebar on the keyboard on the main menu item (like by quarter in the screenshot above) the sub-menu showing other menu items opens to the side.

To get this functionality using react-select I was trying to replace the GroupHeader component so that when I click or activate it with my keyboard it would show the sub-menu items.

Sandbox: https://codesandbox.io/s/react-select-example-12eq7?file=/src/App.js

However when I use my keyboard to navigate through the options in the dropdown it skips over the GroupHeader, I have looked through the documentation but I am having trouble finding if or how I can make this focusable. I wanted to see if anyone had run into this before or perhaps had another suggestion on how to approach this problem.

question from:https://stackoverflow.com/questions/65852295/give-groupheader-keyboard-focus-react-select

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...