Skip to content

Commit 35fca9d

Browse files
Jbernardyoobiciamdustan
authored andcommitted
fix smoothscroll not working with shadow DOM (#133)
* fix smoothscroll not working with shadow DOM Adding the el.host will allow this plugin to work with shadow DOM. Before that, el.parentNode on a shadow-root returned null and failed. * Update smoothscroll.js * Update smoothscroll.js
1 parent 0f42c8a commit 35fca9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/smoothscroll.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function polyfill() {
157157
*/
158158
function findScrollableParent(el) {
159159
while (el !== d.body && isScrollable(el) === false) {
160-
el = el.parentNode;
160+
el = el.parentNode || el.host;
161161
}
162162

163163
return el;

0 commit comments

Comments
 (0)