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
reset tooltip position on scroll #56209
reset tooltip position on scroll #56209
Changes from 15 commits
a6b5f75
e04e6da
b5957f6
8aa3e13
66a337f
9591074
d694671
ae23518
8dd063b
61008a6
97ba896
039ff0e
008d4f3
0aa4535
14cfc5a
51ce273
d384480
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.
In theory, we only display 1 educational tooltip at a time. Is it easier if we can reuse the existing scrolling event here
App/src/components/InvertedFlatList/index.tsx
Lines 33 to 48 in 0856182
And we also introduce additional prop to EducationalTooltip (i.e shouldHideOnScroll). Then we check if it's displayed and shouldHideOnScroll, we will hide/display tooltip. Wdyt?
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 need show/hide tooltip in scrolling for SearchPage as well so I have created new hook. And in future we need to add more we can reuse same hook. So as per me current implementation can be reused in other places as well. Let me know if you have any other opinion.
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.
The problem with this approach:
SelectionList
.LHNOptionsList
, we probably forgot to remove this scroll event emitter as well.The new hook is a good idea, I like it. It helps reuse. But if we can also have a way to avoid above concerns, that should be great. Any thoughts? Something like put this new hook into
SelectionList
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.
@hoangzinh I did not understand what you are trying to say. Can you please provide code snippet about your thoughts?
What I understand is, we need to call triggerScrollEvent() whenever scrolling happened, and also this is not limited to SelectionList right? We can have different types of wrapper which can scroll, so I am not sure if we can make changes in one places and it will be applied to all the places.
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.
In
LHNOptionsList
we usedFlashList
component while inSearch
we useSelectionListWithModal
which internally useSelectionList
so I think it is better idea to use the new hook and trigger the event whenever necessary.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.
Hmm I see the problem. Basically, what I meant is putting useScrollEventEmitter in SelectionList, so other components using SelectionList, we don't need to initialize
useScrollEventEmitter
anymore. Anyways, I'm good with current, but 2 things:Can you add a comment above this line, to explain why do we need this line? It will help to remove/improve later.
App/src/components/LHNOptionsList/LHNOptionsList.tsx
Line 70 in ae23518
I'm still thinking that we don't need to inject tooltipName into
useScrollEventEmitter
and simply calluseScrollEventEmitter()
. Reason: In some components, we have 2-3 kinds of EducationalTooltip. For example, inOptionRowLHN
, it has 2 kinds of tooltipApp/src/components/LHNOptionsList/OptionRowLHN.tsx
Line 73 in fc643d5
If we go with current approach, do we need to setup 2 useScrollEventEmitter?
My thoughts here is we can introduce an additional prop
shouldHideOnScroll
in BaseEducationalTooltip, then only setup 1useScrollEventEmitter()
inOptionRowLHN
and passshouldHideOnScroll={true}
hereApp/src/components/LHNOptionsList/OptionRowLHN.tsx
Lines 189 to 201 in fc643d5
wdyt? @mohit6789
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.
Let me try to implement it, and see if this will work or not
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.
Changes pushed