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

fix: re-introduce prevSelectedId to change focus when selection changes #1091

Merged
merged 5 commits into from
Jan 19, 2025

Conversation

TheAlmightyCrumb
Copy link
Contributor

@TheAlmightyCrumb TheAlmightyCrumb commented Jan 14, 2025

Re-introduce the anti-pattern of changing a state while in the rendering phase (unless a better way exists) to sync focus to selection changes.

now it gets the id of the item last selected if there is no focus
@TheAlmightyCrumb
Copy link
Contributor Author

@alissawix @PeterShershov Please inspect this commit: cd361a1
Let me know what you think about it.
If agreed - I'll refactor the hook, mostly names so it is coherent, and rename files correspondingly.

@TheAlmightyCrumb TheAlmightyCrumb merged commit 2c4f13d into master Jan 19, 2025
6 checks passed
@TheAlmightyCrumb TheAlmightyCrumb deleted the sagivd/focus-last-selected branch January 19, 2025 09:54
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