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

add option to disable moving the dom element #84

Closed

Conversation

piotrpalek
Copy link

Hey, I was trying to use tether with Ember.js and it works more or less fine. I encountered a problem while trying to test a component I made with tetherjs. The problem is that tether always moves the element to the body tag and I get why it does so (predictable positioning).
But when I am running the ember test suite it renders the ember application into a special container, and not like normally into the body tag. I need to be able to tell tether to stop moving the element during the tests, where the position isn't really important, because it breaks my app when it tries to move the element to the body tag.

As far as I am aware there is one more place where tether moves the element to the body tag, but that can be disabled by disabling the moveElement option.

I am of course open to changing the name of the option or other suggestions you may have. This is just something that is really neccesary to be able to use tether at all in my app.

@vanthome
Copy link

vanthome commented Jun 9, 2015

Hi,

I have a more critical issue with this behavior. I'm have an Ember.JS components with some containing controls which opens as a tethered element.
The problem is that I cannot handle the events in the parent component because Ember's event model seem to require that events must origin from an actual DOM child.

I tried to disable the movement as in this PR. Then unfortunately the positioning seems not to be correct in a scrolling container :(

Anyways, I think it's no intuitive to have an option moveElement and when set to false to still move the element, so this PR should be accepted and/ or merged with moveElement.

Greets

@pzuraq
Copy link

pzuraq commented Jun 18, 2015

I also support this PR, we are currently using ember-wormole which warps the element to another specified container already (typically somewhere near the body in the DOM). For liquid-fire (animation) integration we are going to need to be able to attach the tether to some child of the body rather than to the body itself.

@Evan-M
Copy link

Evan-M commented Jun 20, 2015

Looks like the project source code was changed from coffeescript to ec6... thus blocking the pull request?

@andnp
Copy link

andnp commented Jul 8, 2015

I too am having a similar issue with my app. My use case requires me to make the tethered element a child of another element in the DOM other than body. I wonder if it would be more beneficial to have an optional parameter (newRoot?) that defines where the tethered element is placed. This should be able to handle the Ember.js use cases as well as further abstracting some of the functionality of this library.

@pzuraq
Copy link

pzuraq commented Jul 14, 2015

I submitted #96, which updates this PR and bumps the version number. Still haven't gotten a response from HubSpot, hopefully that'll come soon.

@geekjuice
Copy link
Contributor

The conversation seems to be continuing in #96, so closing in favor of that PR

@geekjuice geekjuice closed this Jul 23, 2015
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.

6 participants