Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: Selecting last possible member to group hides selected members. #34847
fix: Selecting last possible member to group hides selected members. #34847
Changes from 2 commits
1720478
1176d22
89c96b1
47e6c4f
7191323
f924ea0
b04e153
efa6bfa
40b30f0
5b42bdf
ec468ed
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can we also update this comment to explain the new changes?
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.
Also since this is pretty much copy / pasted in 3 files, should we make it a reusable lib?
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.
Yes, I think we should do both.
cc: @Krishna2323
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.
@c3024, comments have been updated, can you help me understanding what do you mean by making it reusable lib, the
setSearchTermAndSearchInServer
usesuseCallback
&setState
.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.
We extract this
to a function in
OptionListUtils.ts
(or a more appropriate file) and use it in the three pages. @Krishna2323There 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.
@c3024, I believe it will over complicate things, as we need to use useCallback because we pass it to
OptionsSelector
.Otherwise the option seems to create a util function that returns a function which will be used inside useCallback but as I said it will complicate things. Current implementation looks simpler to me and its just few lines of code, so I don't think we should extract few lines and still use useCallback which is a must.
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.
How about a custom hook like this?
and use it in the pages like this
WDYT? @Beamanator
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.
I like that plan @c3024 👍 looks like we have a decent amount of custom hooks in the
src/hooks
directory, so this would be a nice one to addThere 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.
@c3024, can you pls review once, created the hook and tested.