-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
✨ (entity selector) keep selected entities in options list #4035
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @sophiamersmann and the rest of your teammates on Graphite |
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2024-10-22 12:04:20 UTC |
CleanShot.2024-10-09.at.14.23.35.mp4One thing I did notice here is that the checkboxes are behaving weirdly when using keyboard navigation (i.e. tab and space). I'm seeing this in both Edge and Firefox. |
This is just a draft implementation – I just changed as few lines as possible to get a staging site I could share. If the problem you're describing also exists on prod, then probably worth opening an issue for it. I'll keep this in mind though when I'm working on it :) |
2d6b8d7
to
22f19f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, and great that we can get rid of a load of code! 🐰
I found a few small things, but great work otherwise :)
packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx
Outdated
Show resolved
Hide resolved
packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx
Outdated
Show resolved
Hide resolved
76a79d6
to
24c808c
Compare
24c808c
to
98e257c
Compare
Resolves #3920
Keeps selected and unselected entities both in the list of entities to choose from.
I didn't remove the animation library because the animations make it look a bit smoother when the list of selected entities is in view.
Browsers like Chrome and Firefox are smart enough not to do a layout shift when a new entity is selected while the list of selected entities is not currently in view. But in other browsers like Safari, selecting a new entity always leads to a layout shift. The animation also helps here to make the layout shift a bit less jarring.
Marcel's point below is addressed :)