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

Morphology pop-up is sticky to last word after activate/deactivate Alpheios while still logged in #248

Closed
monzug opened this issue Sep 26, 2019 · 10 comments
Labels
safari safari-specific issues verified

Comments

@monzug
Copy link

monzug commented Sep 26, 2019

tested in Safari 3.0.1.72 and developer build. to repro:

  1. log in and double click on some latin words from https://www.thelatinlibrary.com/martial/mart12.shtml.
  2. close Alpheios, while still logged in.
  3. Reactivate Alpheios and double click on any latin word from above text. The morphology pop-up is the one of the last word lookup before closing Alpheios.
  4. any subsequent double-click does show the same pop-up
@monzug monzug added the safari safari-specific issues label Sep 26, 2019
@balmas balmas assigned kirlat and unassigned balmas Sep 26, 2019
@balmas
Copy link
Member

balmas commented Sep 26, 2019

@kirlat Monica says this is new in the latest build.

@monzug
Copy link
Author

monzug commented Sep 26, 2019 via email

@kirlat
Copy link
Member

kirlat commented Sep 26, 2019

I can reproduce the problem, will work on fixing it

@kirlat
Copy link
Member

kirlat commented Sep 26, 2019

This is a truly weird issue. We have a createSelectionFromPoint() function that creates a range for a selected word. On Safari it uses doc.caretRangeFromPoint() to create start and end ranges. Usually it works without any problem, but if to disable an Alpheios UI controller and enable it again after that (no matter logged in or not), this function returns a null object. As a result, selection for a double clicked word cannot be made and the old word is shown.

If to refresh a page, an issue is be fixed.

I will investigate it further.

kirlat pushed a commit to alpheios-project/components that referenced this issue Sep 26, 2019
@kirlat
Copy link
Member

kirlat commented Sep 26, 2019

I think I've found a solution.

When we disable an Alpheios, we assign to the page body a class that prevents word selection. This is to prevent user from doing any word selection while an Alpheios is deactivated. However, we were not always removing this class after Alpheios is reactivated. This prevented caretRangeFromPoint() from working properly.

A simple fix with couple of lines of code should fix that.

@kirlat
Copy link
Member

kirlat commented Sep 26, 2019

@monzug I think this is a great catch! This code was there for like almost forever and we were not noticing; yet you've found a scenario where it showed.

@kirlat
Copy link
Member

kirlat commented Sep 27, 2019

The fixes has been merged into components#master. It will require rebuilding a webextnesion in order for them be available in Safari.

@balmas
Copy link
Member

balmas commented Sep 27, 2019

qa 3.0.1.73/components 1.2.48 (Safari build in dropbox)

@balmas balmas closed this as completed Sep 27, 2019
@monzug
Copy link
Author

monzug commented Sep 27, 2019

fixed. Thanks!
@balmas, question: in the user word list, when I limited by this session, I found the list of words from first login and second login. is it ok?

@monzug monzug removed their assignment Sep 27, 2019
@balmas
Copy link
Member

balmas commented Sep 27, 2019

@monzug I think that's okay for now, but probably we ought to fix it in a future release. Will convert to a new issue.

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

No branches or pull requests

3 participants