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 command menu keyboard navigation #2908

Merged
merged 8 commits into from
Dec 13, 2023
Merged

Fix command menu keyboard navigation #2908

merged 8 commits into from
Dec 13, 2023

Conversation

gitstart-twenty
Copy link
Contributor

@gitstart-twenty gitstart-twenty commented Dec 10, 2023

Refer to: #2778 (comment)

Fixes #2746

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
@lucasbordeau lucasbordeau changed the title Add Keyboard navigation on IconPicker Fix command menu keyboard navigation Dec 12, 2023
@@ -3,13 +3,14 @@ import { IconComponent } from '@/ui/display/icon/types/IconComponent';
export enum CommandType {
Navigate = 'Navigate',
Create = 'Create',
Other = 'Other',
Copy link
Contributor

Choose a reason for hiding this comment

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

Other is too vague and at risk of being a catch-all type for everything, we can put 'OpenDrawer' or something like that.

@@ -118,6 +120,17 @@ export const CommandMenu = () => {
],
},
limit: 3,
onCompleted: (data) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should put all the onCompleted in useEffects, because onCompleted isn't retriggered when we're updating the cache with optimistic effects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @lucasbordeau Adding a useEffect just caused too many rerenders, please check out the change I went with.

gitstart-twenty and others added 3 commits December 13, 2023 03:24
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
Copy link
Member

@charlesBochet charlesBochet 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, thank you!

@charlesBochet charlesBochet merged commit e08790c into main Dec 13, 2023
6 of 11 checks passed
@charlesBochet charlesBochet deleted the TWNTY-2746 branch December 13, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Keyboard navigation on IconPicker
3 participants