FIX: use css instead of js to fix select-kit-collection max-height

This commit is contained in:
Joffrey JAFFEUX 2018-02-01 16:56:07 +01:00 committed by GitHub
parent 9923829402
commit 97ddaeeae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 2 additions and 25 deletions

View File

@ -9,7 +9,6 @@ export default ComboBoxComponent.extend({
classNameBindings: ["categoryStyle"],
classNames: "category-drop",
verticalOffset: 3,
collectionHeight: "200",
content: Ember.computed.alias("categories"),
rowComponent: "category-row",
headerComponent: "category-drop/category-drop-header",

View File

@ -7,7 +7,6 @@ export default DropdownSelectBoxComponent.extend({
pluginApiIdentifiers: ["composer-actions"],
classNames: "composer-actions",
fullWidthOnMobile: true,
collectionHeight: "auto",
autofilterable: false,
filterable: false,
allowInitialValueMutation: false,

View File

@ -8,7 +8,6 @@ export default DropdownSelectBoxComponent.extend({
nameProperty: "key",
fullWidthOnMobile: true,
content: allLevels,
collectionHeight: "auto",
castInteger: true,
autofilterable: false,
filterable: false,

View File

@ -4,7 +4,6 @@ export default DropdownSelectBoxComponent.extend({
classNames: ["period-chooser"],
rowComponent: "period-chooser/period-chooser-row",
headerComponent: "period-chooser/period-chooser-header",
collectionHeight: "auto",
content: Ember.computed.alias("site.periods"),
value: Ember.computed.alias("period"),
isHidden: Ember.computed.alias("showPeriods"),

View File

@ -54,7 +54,6 @@ export default Ember.Component.extend(UtilsMixin, PluginApiMixin, DomHelpersMixi
headerComputedContent: null,
collectionHeaderComputedContent: null,
collectionComponent: "select-kit/select-kit-collection",
collectionHeight: 200,
verticalOffset: 0,
horizontalOffset: 0,
fullWidthOnMobile: false,

View File

@ -8,7 +8,6 @@ export default ComboBoxComponent.extend({
classNameBindings: ["categoryStyle", "tagClass"],
classNames: "tag-drop",
verticalOffset: 3,
collectionHeight: "200",
value: Ember.computed.alias("tagId"),
headerComponent: "tag-drop/tag-drop-header",
rowComponent: "tag-drop/tag-drop-row",

View File

@ -6,7 +6,6 @@ export default DropdownSelectBoxComponent.extend({
classNames: ["toolbar-popup-menu-options"],
isHidden: Ember.computed.empty("computedContent"),
showFullTitle: false,
collectionHeight: "auto",
@computed("title")
collectionHeader(title) {

View File

@ -42,7 +42,6 @@ export default Ember.Mixin.create({
@on("didRender")
_adjustPosition() {
this.$collection().css("max-height", this.get("collectionHeight"));
this._applyFixedPosition();
this._applyDirection();
this._positionWrapper();

View File

@ -95,6 +95,7 @@
.select-box-kit-collection, .select-kit-collection {
padding: 0;
max-height: auto;
}
.dropdown-select-box-header {

View File

@ -197,6 +197,7 @@
border-radius: inherit;
-webkit-overflow-scrolling: touch;
margin: 0;
max-height: 200px;
.select-kit-collection {
padding: 0;

View File

@ -158,23 +158,6 @@ componentTest('doesnt render collection content before first expand', {
}
});
componentTest('supports options to limit size', {
template: '{{single-select collectionHeight=20 content=content}}',
beforeEach() {
this.set("content", ["robin", "régis"]);
},
test(assert) {
this.get('subject').expand();
andThen(() => {
const height = find(".select-kit-collection").height();
assert.equal(parseInt(height, 10), 20, "it limits the height");
});
}
});
componentTest('dynamic headerText', {
template: '{{single-select value=1 content=content}}',