DEV: makes sk scroll to current selection (#9492)
This commit is contained in:
parent
4f834f0008
commit
79058a6d99
|
@ -883,10 +883,31 @@ export default Component.extend(
|
|||
|
||||
this._safeAfterRender(() => {
|
||||
this._focusFilter();
|
||||
this._scrollToCurrent();
|
||||
this.popper && this.popper.update();
|
||||
});
|
||||
},
|
||||
|
||||
_scrollToCurrent() {
|
||||
if (this.value && this.mainCollection) {
|
||||
let highlighted;
|
||||
if (this.valueProperty) {
|
||||
highlighted = this.mainCollection.findBy(
|
||||
this.valueProperty,
|
||||
this.value
|
||||
);
|
||||
} else {
|
||||
const index = this.mainCollection.indexOf(this.value);
|
||||
highlighted = this.mainCollection.objectAt(index);
|
||||
}
|
||||
|
||||
if (highlighted) {
|
||||
this._scrollToRow(highlighted);
|
||||
this.set("selectKit.highlighted", highlighted);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_focusFilter(forceHeader = false) {
|
||||
this._safeAfterRender(() => {
|
||||
const input = this.getFilterInput();
|
||||
|
|
Loading…
Reference in New Issue