Skip to content

Commit 23d8874

Browse files
committed
more fixes. scrolling works, one other test fails for god knows why.
1 parent 8faa2c1 commit 23d8874

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/core/dom.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ const toNodeArray = (nodes) => {
5353

5454

5555
function ensure_array(obj) {
56+
if (typeof obj === "undefined") {
57+
return []
58+
}
5659
const is_array = typeof obj[Symbol.iterator] === 'function' && typeof obj !== 'string';
5760
if (is_array) {
5861
return [...obj];

src/pat/inject/inject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ const inject = {
557557
// 2) getting the element to scroll to (if not "top")
558558
const scroll_target = ["top", "target"].includes(cfg.scroll)
559559
? cfg.$target[0]
560-
: dom.querySelectorAllAndMe($injected[0], cfg.scroll);
560+
: dom.querySelectorAllAndMe($injected, cfg.scroll)[0];
561561

562562
const scroll_container = dom.find_scroll_container(
563563
scroll_target,

0 commit comments

Comments
 (0)