Skip to content

Commit 9bb6117

Browse files
committed
style(FilterPanel): remove additional scroll bar
1 parent 6b64e4b commit 9bb6117

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

assets/css/_tag-selecter.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@
1010
list-style-type: none;
1111
padding: 0 20px 0 20px;
1212
max-height: 0;
13-
overflow-y: scroll;
14-
overflow-x: hidden;
13+
overflow: hidden;
1514
@include transitionHelper(max-height .4s ease);
1615

1716
&.active {
18-
max-height: 300px;
17+
max-height: inherit;
1918
}
2019

2120
}
2221

22+
input {
23+
width: 100%;
24+
}
25+
2326
li {
2427
margin-bottom: 10px;
2528
}

components/Panel/Item/FilterPanel.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,8 @@
412412
*/
413413
toggleList(tagSelecter: CheckBoxSelecter) {
414414
if (this.selectedTagSelecter !== undefined) {
415-
this.selectedTagSelecter.$data.active = false;
415+
// @ts-ignore
416+
this.selectedTagSelecter.closeList();
416417
this.selectedTagSelecter = undefined;
417418
}
418419
@@ -535,8 +536,6 @@
535536
.selectable-tags {
536537
list-style-type: none;
537538
padding: 0;
538-
overflow-y: scroll;
539-
overflow-x: visible;
540539
height: 100%;
541540
margin-bottom: 0;
542541

components/Search/CheckBoxSelecter.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Icon type="arrowRight"/>
55
<slot></slot>
66
</span>
7-
<ul :class="{active}">
7+
<ul ref="list">
88
<li>
99
<input type="text" class="input--primary-color" v-model="filter" placeholder="Filtrer">
1010
</li>
@@ -20,7 +20,7 @@
2020

2121
<script lang="ts">
2222
import CheckBox from "~/components/Input/CheckBox.vue";
23-
import {Vue, Component, Prop, Emit, Watch} from "vue-property-decorator";
23+
import {Vue, Component, Prop, Emit, Watch, Ref} from "vue-property-decorator";
2424
import {CheckboxObject, CheckBoxObjectEmitted, CheckboxSelecterObjectEmitted} from "~/types";
2525
import Icon from "~/components/Symbols/Icon.vue";
2626
@@ -33,6 +33,7 @@
3333
export default class CheckBoxSelecter extends Vue {
3434
@Prop({type: Array, required: true}) readonly defaultOptions!: CheckboxObject[];
3535
@Prop({type: Boolean, default: false}) readonly selectAllOption!: boolean;
36+
@Ref() list!: HTMLElement;
3637
3738
filter: string = "";
3839
active: boolean = false;
@@ -52,6 +53,19 @@
5253
@Emit()
5354
toggleList(): CheckBoxSelecter {
5455
this.active = !this.active;
56+
57+
if(this.active) {
58+
this.list.style.maxHeight = this.list.scrollHeight.toString() + "px";
59+
} else {
60+
this.list.style.maxHeight = "0";
61+
}
62+
63+
return this
64+
}
65+
66+
closeList(): CheckBoxSelecter {
67+
this.active = false;
68+
this.list.style.maxHeight = "0";
5569
return this
5670
}
5771

0 commit comments

Comments
 (0)