diff --git a/asset/js/widget/ActionList.js b/asset/js/widget/ActionList.js index c1033ada..77ce1b8d 100644 --- a/asset/js/widget/ActionList.js +++ b/asset/js/widget/ActionList.js @@ -14,6 +14,14 @@ define(["../notjQuery"], function ($) { this.lastActivatedItemUrl = null; this.lastTimeoutId = null; this.processing = false; + this.isDisplayContents = false; + + let firstItem = this.getDirectionalNext(null, false); + if (firstItem + && (! firstItem.checkVisibility() && firstItem.firstChild && firstItem.firstChild.checkVisibility()) + ) { + this.isDisplayContents = true; + } } bind() { @@ -406,9 +414,13 @@ define(["../notjQuery"], function ($) { * @param isArrowUp Whether the arrow up key is pressed, if not, arrow down key is assumed */ scrollItemIntoView(item, isArrowUp) { - item.scrollIntoView({block: "nearest"}); let directionalNext = this.getDirectionalNext(item, isArrowUp); + if (this.isDisplayContents) { + item = item.firstChild; + directionalNext = directionalNext ? directionalNext.firstChild : null; + } + item.scrollIntoView({block: "nearest"}); if (directionalNext) { directionalNext.scrollIntoView({block: "nearest"}); }