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

Option to add an offset/padding #107

Closed
luxferresum opened this issue Jan 20, 2018 · 3 comments
Closed

Option to add an offset/padding #107

luxferresum opened this issue Jan 20, 2018 · 3 comments

Comments

@luxferresum
Copy link

@luxferresum luxferresum commented Jan 20, 2018

On the demo site there is an offset between the tooltip and the target:

image

But when I tried to implement the tooltip I never get this offset:

image

So I think some documentation is missing here at least. Any help about this?
I've realized there is an undocumented isOffset feature in the code. Also the corresponding test uses margin-bottom, which works, but breaks when the popper flips. What is the recommended way to do this, and can this please be documented somewhere?

@kybishop

This comment has been minimized.

Copy link
Owner

@kybishop kybishop commented Jan 22, 2018

Hey @luxferresum, I'll write something up for you soon, just a little swamped playing catch-up on work after a brutal week-long cold.

@kybishop

This comment has been minimized.

Copy link
Owner

@kybishop kybishop commented Jan 26, 2018

Here's a brief summary of how the offset works:

The attachment is actually two containers, an outer container for the positioning addon, ember-popper, and an inner container for the animations.

The outer container is set up just like you'd expect, positioned right next to the target. It is the inner container that is implementing the offset.

The default animations for ember-attacher do this with a CSS transform property on the inner container:

transform is the CSS magic that allows our animations to smoothly shift up/down, left/right, etc.

@kybishop

This comment has been minimized.

Copy link
Owner

@kybishop kybishop commented Feb 20, 2018

I have documented this a little more thoroughly in the README when talking about how animations are implemented. Hopefully this clears up confusion over the perceived offset.

@kybishop kybishop closed this Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.