Escape focus inside of GridList #8482
Replies: 2 comments 1 reply
-
Hi, thanks for the discussion. I'm not going to open a pdf attachment. Can you please either create a codesandbox, stackblitz or a github project that can be safely viewed? Are you using the GridList prop |
Beta Was this translation helpful? Give feedback.
-
Haha fair enough @snowystinger. ive added a code sandbox. Tabbing seems to work, but I think we can agree that with large lists, using arrow keys would be a more ideal user experience. Would you consider the escape focus functionality that I described above to be an anti pattern, or something that potentially would be worth pursuing? I could get something working, with my implementation using the exposed useGridList hooks, but it basically came down to deleting the onkeydown from the row when focus was on the container, and having a custom onKeyDown function active at that point. Pretty hacky, brittle, and not great. Curious if some sort of escape focus parent/child element is on your radar at all. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I am looking to implement a GridList that allows for inputs, and components with overlays, to be placed inside the GridListItems. This is working almost perfectly out of the box.
however there is an edgecase where when focus gets to an input, left and right keys move focus left and right instead of moving the curser left and right within the input.
Is it possible or advisable to wrap the textinput in a escape focus element, so that when going left and right through the row, focus gets to the wrapper, but not directly to the text input unless enter is pressed? Adjusting tab index does not seem to impact whether or not something can receive focus from left and right arrow keys.
my implementation is custom using the hooks from react-aria and react-stately, but is functionally nearly identical to this:
Thanks for your help and the excellent package.
https://codesandbox.io/p/sandbox/modest-forest-9jh68k
Beta Was this translation helpful? Give feedback.
All reactions