react-spectrum
5917acf0 - Refactor listview to always focus the row (#3000)

Commit
3 years ago
Refactor listview to always focus the row (#3000) * initial work to focus the row instead of the cell * cleanup * tentative approach to always skip focusing the cell * retaining focus on Listview focusable child when it is clicked * making ListView specific keyboard delegate Felt that the previous modifications to GridKeyboardDelegate were too specific to ListView so split out the changes. Also fixes pageUp/Down/Home/End when you are focused on the ListView row (we forgot to pass the layout to the delegate previously) * fixing pageUp/Down operations when within the ListView row needed to override getItemRect for the ListView keyboard delegate so that it always uses the row key, namely due to the gridcell keys being unavailable in the listlayout. Changed getItem and getItemRect to protected funcs in GridKeyboardDelegate so I could do that * adding tests * fixing tests after rebase * refactor to have outer div behave as both gridcell and grid row still need to fix pageUp/down * fixing Home/End needed to override getKeyLeftOf/getKeyRightOf so they dont use getFirstKey or getLastKey or else focus would jump to the last row instead of wrapping inside the cell * fixing test and getting rid of erroneous data id * cleanup * lint * removing todo * updating lint so we check that a dep is actually needed before throwing * removing private * pulling triggerPress outside the act * tentative approach to use ListLayout instead of making a ListGrid keyboard delegate * fixing build * removing useGridRow to ensure the focused key will always be a row also reverts changes to other files that arent necessary anymore. Adds tests for disabled keys * cleanup * adding listview story decorator for before and after focusable elements helps avoid weird test cases like https://github.com/adobe/react-spectrum/pull/3000#issuecomment-1111494915 * making the story input fields only appear at certain screen widths this makes it so the listview doesnt get squished on mobile * addressing review comments
Author
Parents
Loading