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

#185 Fixed popup rendering on Android #186

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

oleksandr-danylchenko
Copy link
Contributor

Issues

See - #185 (comment)

In the #123 I made the popup presence check resilient to the underlying collapsed ranges in the target's selectors.

However, it caused a timing regression on Android. When the annotation is processed in the popup's useEffect, the target and its bounds aren't yet populated.

useEffect(() => {
if (annotation?.id) {
const bounds = r?.state.store.getAnnotationBounds(annotation.id);
setOpen(Boolean(bounds));

image

Also, the timing of the selection change event that populates the target differs on Android:

Android Mac
image image

Changes Made

I added a check for the selectors' presence on the annotation's target. That way, the effect will react properly to their addition and re-run the bounds querying.

@rsimon
Copy link
Member

rsimon commented Dec 16, 2024

I need to look at this tomorrow with a fresh mind (it's been a long day). But whatever you did - it's working, thanks! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants