Skip to content

Commit a8d4219

Browse files
ActionList: Take items with css propery display:contents into account
For example, the elements of icingadb/hostgroup are `display:contents`, which leads to scrollIntoView() having no effect.
1 parent bd407d9 commit a8d4219

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

asset/js/widget/ActionList.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ define(["../notjQuery"], function ($) {
1414
this.lastActivatedItemUrl = null;
1515
this.lastTimeoutId = null;
1616
this.processing = false;
17+
18+
this.isDisplayContants = null;
1719
}
1820

1921
bind() {
@@ -402,6 +404,19 @@ define(["../notjQuery"], function ($) {
402404
* @param pressedKey Pressed key (`ArrowUp` or `ArrowDown`)
403405
*/
404406
scrollItemIntoView(item, pressedKey) {
407+
if (this.isDisplayContants
408+
|| (! item.checkVisibility() && item.firstChild && item.firstChild.checkVisibility())
409+
) {
410+
// it's a pseudo item: display:contents, because the child is visible
411+
this.isDisplayContants = true;
412+
item.firstChild.scrollIntoView({block: "nearest"});
413+
let directionalNext = this.getDirectionalNext(item, pressedKey);
414+
415+
if (directionalNext) {
416+
directionalNext.firstChild.scrollIntoView({block: "nearest"});
417+
}
418+
}
419+
405420
item.scrollIntoView({block: "nearest"});
406421
let directionalNext = this.getDirectionalNext(item, pressedKey);
407422

0 commit comments

Comments
 (0)