Skip to content

Virtualized list items get refocussed when recreated#15604

Closed
markhicken wants to merge 2 commits intodesktop:developmentfrom
markhicken:development
Closed

Virtualized list items get refocussed when recreated#15604
markhicken wants to merge 2 commits intodesktop:developmentfrom
markhicken:development

Conversation

@markhicken
Copy link
Contributor

@markhicken markhicken commented Nov 11, 2022

Closes #issue 2957

Description

As described in the issue, virtualized list items lose focus when scrolled out of view (because they are unmounted).

See comments with screenshots below...

Screenshots

  1. When scrolled back into view, this PR refocuses them.

    FocusRestored

  2. We only want to restore focus if it was unintentionally lost. We'll keyboard tab away from the list to validate this.

    FocusNotRestored

  3. Note that up and down keys still work as expected after refocussing.

    UpDownFocusRetained

Release notes

Notes:

  • Fixes an issue where selected files lost focus when scrolled out of view and then back into view.

@markhicken
Copy link
Contributor Author

@niik would you mind kicking the workflows for me or let me know who can?

@niik
Copy link
Member

niik commented Nov 18, 2022

Hey @markhicken, sorry for the late response. Thanks so much for wanting to contribute a fix to this long standing and annoying issue! While reviewing your changes I wanted to see if there was a way for us to combine this work with a fix so that keyboard navigation continues to work, that's the way the List component was intended to work and the reason why the Grid component has a tabIndex (for programmatic focus).

I took a stab at this in #15641 and added you as a co-author, please take a look at those changes and see if they make sense to you. In the meantime I'll close this PR as superseded by #15641 but if that work doesn't make it for some reason we can always reopen this.

@niik niik closed this Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants