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

Fix for wrongly positioned tooltip #671

Merged
merged 1 commit into from
Feb 16, 2018

Conversation

Luukschoen
Copy link
Contributor

@Luukschoen Luukschoen commented Dec 7, 2017

Solves #469.

event.pageX - event.target.getBoundingClientRect().left gives me a different value then event.offsetX as where as in Firefox and IE these two result in exactly the same numbers. The difference between the numbers in Chrome is compensated by subtracting this.dims.xOffset.

To make this work in all browsers we could just use
const xPos = event.pageX - event.target.getBoundingClientRect().left; instead of using offsetX and subtracting it with dims.xOffset.

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
See #469

What is the new behavior?
posX is now cross browser always the same.

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

Solves swimlane#469. 

event.pageX - event.target.getBoundingClientRect().left gives me a different value then event.offsetX as where as in Firefox and IE these two result in exactly the same numbers. The difference between the numbers in Chrome is compensated by subtracting this.dims.xOffset. 

To make this work in all browsers we could just use
const xPos = event.pageX - event.target.getBoundingClientRect().left; instead of using offsetX and subtracting it with dims.xOffset.
@jamie94bc
Copy link

Any chance of getting this merged and released?

@fgustovo
Copy link

fgustovo commented Jan 17, 2018

@jamie94bc Shush! swimlane is sleeping :)

@jvzanatta
Copy link

Pls do

@marjan-georgiev marjan-georgiev merged commit 99ebe39 into swimlane:master Feb 16, 2018
@marjan-georgiev
Copy link
Member

Thank you! 👍

@fgustovo
Copy link

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.

5 participants