Ghost/ghost/admin/lib/koenig-editor/addon/components/koenig-menu-content.js
Kevin Ansfield 79d9179289 Added scroll-into-view behaviour for slash menu selection
no issue

- when selecting items with arrow keys in the slash menu, scroll the selected item into view if it's not visible
2020-10-27 16:15:58 +00:00

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'
});
}
}
}