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

Tooltip on scroll container #3

Closed
renatodeleao opened this issue Oct 31, 2017 · 2 comments
Closed

Tooltip on scroll container #3

renatodeleao opened this issue Oct 31, 2017 · 2 comments
Labels

Comments

@renatodeleao
Copy link

renatodeleao commented Oct 31, 2017

Heys! Cool lib! while scanning through the demos spotted a small bug on tooltip positioning.
Calculation is wrong when tooltip on scroll container, because parent.offsetWidth < parent.scrollWidth.
demo

Possible Solution (pseudo-code)

Since it's not parent that is scrollable, but some outer wrapper div you could:

  1. Add class targeting the scroller ('frappe-chart-outer') or something
  2. Check if scroller is scrollable this could be done with
scrollWidth > offsetwith ? isScrollable : notScrollable
  1. then use which suits best on calc_position()
this.scroller = 'scrollerEl';
calc_position() {
  ...
  let max_left = (isScrollable? this.scroller.scrollWidth : this.parent.offsetWidth)  - this.container.offsetWidth;
}

As i've stated, this is pseudo code and i haven't tested it. I might try it and submit a PR if you want but probably only have time on Friday.

Cheers and good luck with this!

@achillesrasquinha
Copy link
Contributor

Hi, send in a PR.

@pratu16x7
Copy link
Contributor

pratu16x7 commented Nov 3, 2017

@renatodeleao Thanks for reporting! We'll try and fix this asap, but a PR would be wonderful :D

@pratu16x7 pratu16x7 added the bug label Nov 8, 2017
maciej-ka added a commit to maciej-ka/charts that referenced this issue Nov 8, 2017
Changes positining of tooltip from absolute to fixed.

Closes: frappe#3
maciej-ka added a commit to maciej-ka/charts that referenced this issue Nov 24, 2017
Changes positining of tooltip from absolute to fixed.

Closes: frappe#3
maciej-ka added a commit to maciej-ka/charts that referenced this issue Dec 1, 2017
Changes positining of tooltip from absolute to fixed.

Closes: frappe#3
@pratu16x7 pratu16x7 mentioned this issue Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants