Closed zanedev closed 1 year ago
The original code for that return statement is very sloppy, as it doesn't check the existence of the target parameter in either of the clauses. This pull request fixes the issue of it not existing, but introduces another problem when it doesn't return the target property as last condition of that clause.
Personally I would open up the whole clause to a more readable code block rather than try to cram it all into one line, but I think this would be the proper fix for that particular problem:
return !ascend && target && (target.className && target.className.indexOf(scrollIndicatorClassName) > -1 && target || o.closest(target.parentNode));
Don't think they care lol closing
Don’t confuse not caring with not having the time to review this one quite yet, gonna leave it open for now if that’s ok with you all
We were seeing a random error in newrelic logs about target not being available. Changed this to check for target before trying to accessing a property of it.