Open JingkangZhang opened 7 months ago
From my preliminary investigation, in this unhappy case, isInView here becomes false when the scroll happens and the menu gets closed.
So two monkey patches came to me, that I tested and confirmed would work:
delete the logic to position the dropdown on top - never place it on top. This is not ideal when it's opening up at the very bottom. Well, actually, it just might be that the top px calculation is off - perhaps the calculation is supposed to make sure it doesn't overlap, but it does visually.
could be something wrong with this isTriggerVisibleInNearestScrollContainer function - not clear what is not visible here, and then, why close the dropdown at all on scrolling? So getting rid of the logic entirely seems to work for me.
but yeah, pretty shallow reading of the logic on my end for sure, hope experts can chime in. cc @tylerjbainbridge
In some edge cases, the component dropdown plugin cannot be scrolled correctly - if you scroll down, the dropdown disappears. Fairly frustrating user experience.
https://github.com/facebook/lexical/assets/30300487/67a496fc-2cb1-4ea8-ba17-74959612bb2b
Lexical version: live on the playground as of now
Steps To Reproduce
Link to code example:
The current behavior
see above
The expected behavior
dropdown shouldn't disappear