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
luxzeitlos opened this issue Jan 20, 2018 · 3 comments
Closed

Option to add an offset/padding #107

luxzeitlos opened this issue Jan 20, 2018 · 3 comments

Comments

@luxzeitlos
Copy link

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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.

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

No branches or pull requests

2 participants