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
Allow zeroElement parent to be configurable. #374
Allow zeroElement parent to be configurable. #374
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I am in favor of this in general. We need to fix the test failures, and possibly support passing both selectors and HTMLElement instances to bodyElement
. Thoughts on that?
Definitely! I'll work on that. What would be some good tests to add? |
@deanmarano the main thing is we need to fix the existing tests. The build is currently failing. Adding additional tests for the functionality would be great too though. |
Build passing! |
I realized that this is on the beta 2 version, and there hasn't been an official release of that. Should I also do this on the 1.4.6 version? For context, I'm trying to get this into ember-tether to fix yapplabs/ember-tether#33. ember-tether is currently on the 1.4 version. |
@deanmarano the v2 betas have been officially released, check https://www.npmjs.com/package/tether/v/2.0.0-beta.4 v2 is all we are working on. We're not back porting fixes to v1. ember-tether will need to update to the v2 beta. I don't think there are any API changes, the breaking change is dropping IE 9 support, which Ember only supports IE11, I think, so we should be okay. |
src/js/constraint.js
Outdated
@@ -1,7 +1,6 @@ | |||
import { getClass, updateClasses } from './utils/classes'; | |||
import { defer } from './utils/deferred'; | |||
import { extend } from './utils/general'; | |||
import { getBounds } from './utils/bounds'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend we keep the bounds utils as utils, and import them. I think the reason you are doing tether.bounds
is for the this
context, correct? I would pass this.bodyElement
as a param, rather than making these utils need to be tied to tether. Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup! will refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you do a release with this in it? Thanks! 🙏 |
@deanmarano yeah, sure thing! I will cut a new beta |
Thanks! |
The body element is configurable, but the zeroElement gets placed on the body by default. This brings the zeroElement in line with the option to pass the body element.