mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
79d9179289
no issue - when selecting items with arrow keys in the slash menu, scroll the selected item into view if it's not visible
15 lines
369 B
JavaScript
15 lines
369 B
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
|
|
export default class KoenigMenuContentComponent extends Component {
|
|
@action
|
|
scrollIntoView(element, [doScroll]) {
|
|
if (doScroll) {
|
|
element.scrollIntoView({
|
|
behavior: 'smooth',
|
|
block: 'nearest'
|
|
});
|
|
}
|
|
}
|
|
}
|