-
Notifications
You must be signed in to change notification settings - Fork 7
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
#119 Tempered TextAnnotatorPopup
positioning
#120
#119 Tempered TextAnnotatorPopup
positioning
#120
Conversation
I like the change. But what if the top of the text is scrolled off screen, and the user selects? Right now, the popup would still pop up above the text, outside the visible area, right? I think it's important that the popup will always appear in the visible area - either above or below the text and, at worst, if the selection exceeds both the top and the bottom of the screen, above the annotation. (I guess there are behaviors in floating UI that would achieve that?) |
Yep, that's correct. It's possible to scroll from the popup and make it non-visible. I believe it can be improved with the Screen.Recording.2024-07-18.at.10.46.02.mov
I'm not sure whether the popup should still be visible if the user explicitly scrolled from the selected content. Because it removes the visual connection between them 🤔 |
The issue we face is this: there are sometimes annotations that extend beyond multiple paragraphs, and are larger than the viewport area. If the user clicks an annotation that starts above the screen viewport, and ends below the screen viewport, they won't get a popup at all. (Because it would either be above or below the visible screen area.) That's what we need to avoid in our case. I don't mind if the user actively scrolls the popup out of view. But clicking an annotation always has to open a popup inside the visible viewport area IMO. |
Aha... I see your point now. I'll try to experiment with the |
I found that the most pragmatic solution would be using just the Screen.Recording.2024-07-18.at.11.21.06.mov |
YES! I love it! |
6fcc330
to
38a607f
Compare
Issue - #119
Changes Made
top
positioning of the popup. It prevents it from covering the annotated content and it's placed pretty intuitively (IMHO)useDismiss
hook usageRelations
It prevents the page from accidentally freezing when the user selects the text with the
Ctrl+A
(bug I discovered when working on the #118, seeDemo
Screen.Recording.2024-07-12.at.19.33.39.mov