Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursively check for last item in nested lists #3798

Merged
merged 3 commits into from
Jul 10, 2023

Conversation

bearfriend
Copy link
Contributor

DE53272: List > Grid navigation not navigating properly to deeply nested list items

When looking for the previous item to focus in grid mode, the last item should be checked recursively for nested lists.

@bearfriend bearfriend requested a review from a team as a code owner June 29, 2023 19:35
@github-actions
Copy link
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://pr-3798-brightspace-ui-core.d2l.dev/

Note
The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

@github-actions
Copy link
Contributor

Visual diff tests failed - pull request #3799 has been opened with the updated goldens.

}
return lastItem;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably use do...while. I always forget about that.

}
return lastItem;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, this would have only returned something if the nested list had items -- otherwise it would have fallen out of this block and returned previousElement. I think now if nestedItems initially has nothing in it, lastItem won't get set to anything and the whole thing will return undefined.

Copy link
Member

@dlockhart dlockhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@bearfriend bearfriend merged commit edd4a24 into main Jul 10, 2023
5 checks passed
@bearfriend bearfriend deleted the dgleckler/list-grid-focus-previous branch July 10, 2023 14:52
@ghost
Copy link

ghost commented Jul 10, 2023

🎉 This PR is included in version 2.132.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants