FIX: makes sure fixed positioning is correctly applied and removed

This commit is contained in:
Joffrey JAFFEUX 2017-11-11 10:33:37 -08:00 committed by GitHub
parent d7dbda1503
commit 9219786a24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,10 @@ export default SelectBoxKitComponent.extend({
headerComponent: "dropdown-select-box/dropdown-select-box-header",
rowComponent: "dropdown-select-box/dropdown-select-box-row",
clickOutside() { this.close(); },
clickOutside() {
if (this.get("isExpanded") === false) { return; }
this.close();
},
didSelectValue() {
this._super();

View File

@ -175,13 +175,14 @@ export default Ember.Mixin.create({
},
_applyFixedPosition() {
if (this.get("isExpanded") !== true) { return; }
if (this.get("scrollableParent").length === 0) { return; }
const width = this.$().outerWidth(false);
const height = this.$().outerHeight(false);
const $placeholder = $(`<div class='select-box-kit-fixed-placeholder-${this.elementId}'></div>`);
this._previousScrollParentOverflow = this.get("scrollableParent").css("overflow");
this._previousScrollParentOverflow = this._previousScrollParentOverflow || this.get("scrollableParent").css("overflow");
this.get("scrollableParent").css({ overflow: "hidden" });
this._previousCSSContext = {