File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 55
55
},
56
56
setParentOption () {
57
57
if (! this .isMultiple ()) {
58
- this .parentSelect .selectOption (this .value , this .$refs .item .textContent );
58
+ this .parentSelect .selectOption (this .value , this .$refs .item .textContent , this . $el );
59
59
} else {
60
60
this .check = ! this .check ;
61
61
}
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" md-select" :class =" [themeClass, classes]" >
3
- <md-menu :md-close-on-select =" !multiple" @opened = " $emit('open') " @closed =" $emit('close ')" >
3
+ <md-menu :md-close-on-select =" !multiple" @open = " onOpen " @close =" $emit('closed ')" >
4
4
<span class =" md-select-value" md-menu-trigger ref =" value" >{{ selectedText || placeholder }}</span >
5
5
6
6
<md-menu-content class =" md-select-content" :class =" [themeClass, contentClasses]" >
36
36
mixins: [theme],
37
37
data () {
38
38
return {
39
+ lastSelected: null ,
39
40
selectedValue: null ,
40
41
selectedText: null ,
41
42
multipleOptions: {},
72
73
}
73
74
},
74
75
methods: {
76
+ onOpen () {
77
+ if (this .lastSelected ) {
78
+ this .lastSelected .scrollIntoViewIfNeeded (true );
79
+ }
80
+
81
+ this .$emit (' opened' );
82
+ },
75
83
setParentDisabled () {
76
84
this .parentContainer .isDisabled = this .disabled ;
77
85
},
154
162
155
163
this .changeValue (values);
156
164
},
157
- selectOption (value , text ) {
165
+ selectOption (value , text , el ) {
166
+ this .lastSelected = el;
158
167
this .selectedText = text;
159
168
this .setTextAndValue (value);
160
169
this .changeValue (value);
You can’t perform that action at this time.
0 commit comments