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

Fallback to parent coords in tether-to-selection #141

Merged
merged 1 commit into from
Oct 1, 2017
Merged

Conversation

dtetto
Copy link
Member

@dtetto dtetto commented Sep 26, 2017

A user reported that the link prompt was always offscreen. I traced this down to range.getBoundingClient() returning zero for dimensions and coords in certain cases—I was able to duplicate most reliably by opening a blank editor, hitting “enter”, hitting the “up” key, and finally hitting the link button.

Cases that trigger the issue seemed more prevalent in release Safari than in release Chrome for whatever reason. I could not find the root “cause” of the zeroed-out attributes, but found that falling back to startContainer works fine from a UI perspective—so, admittedly, this is a case of treating the symptom…

A user reported that the link prompt was always offscreen. I traced this down to `range.getBoundingClient()` returning zero for dimensions and coords in certain cases—I was able to duplicate most reliably by opening a blank editor, hitting “enter”, hitting the “up” key, and finally hitting the link button.

Cases that trigger the issue seemed more prevalent in release Safari than in release Chrome for whatever reason. I could not find the root “cause” of the zeroed-out attributes, but found that falling back to `startContainer` works fine from a UI perspective.
@dtetto dtetto requested a review from bantic September 26, 2017 00:42
@bantic
Copy link
Contributor

bantic commented Oct 1, 2017

@dtetto This looks good to me. Thanks for tracking it down!
(I'm surprised the linter is ok with this inline conditional — I might change up that syntax post-merge to fit in better with the surrounding code) :)

@bantic bantic merged commit 1bfd8ca into master Oct 1, 2017
@bantic bantic deleted the dtetto-patch-1 branch October 1, 2017 23:54
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