Project

General

Profile

Bug #11207

Regression in Wt 4.9.0: scrollVisibilityChanged() signal seems to be broken

Added by Emeric Poupon about 1 month ago. Updated 11 days ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
01/01/2023
Due date:
% Done:

100%

Estimated time:

Description

Hello,

I tried to upgrade my project to 4.9.0 but I hit this js error:

TypeError: o is not iterable

The corresponding unminified js code part is:

(function () {
    Wt._p_.response(373291984);
    Wt4_9_0.ScrollVisibility = function (e) {
        const t = e.WT;
        function i(e) {
            return "hidden" !== e.style.visibility && "none" !== e.style.display && !e.classList.contains("out") && (!((e = e.parentNode) && !t.hasTag(e, "BODY")) || i(e));
        }
        let n = 0;
        const o = {},
            s = !1;
        function c(e, n) {
            if (!i(e)) return !1;
            const o = t.widgetPageCoordinates(e),
                s = o.x - document.body.scrollLeft - document.documentElement.scrollLeft,
                c = o.y - document.body.scrollTop - document.documentElement.scrollTop,
                r = t.windowSize(),
                l = s,
                d = e.offsetWidth,
                a = c,
                u = e.offsetHeight,
                f = -n,
                m = r.x + 2 * n,
                v = -n,
                b = r.y + 2 * n;
            return l + d >= f && f + m >= l && a + u >= v && v + b >= a;
        }
        function r() {
            for (const t of o) { // ---> TypeError: o is not iterable <-----
                const i = c(o[t].el, o[t].margin);
                if (i !== o[t].visible) {
                    o[t].visible = i;
                    e.emit(o[t].el, "scrollVisibilityChanged", i);
                }
            }
        }

Is it known? I use scrollVisibilityChanged() with sentinel elements to implement several infinite loading pages contained in a WStackedWidget.
Maybe there is something badly done on my side?

#1

Updated by Roel Standaert 22 days ago

  • Status changed from New to InProgress
  • Assignee set to Roel Standaert
  • Target version set to 4.9.1
#2

Updated by Roel Standaert 22 days ago

  • Status changed from InProgress to Review
  • Assignee changed from Roel Standaert to Korneel Dumon
#3

Updated by Roel Standaert 18 days ago

  • Assignee deleted (Korneel Dumon)
#4

Updated by Marnik Roosen 18 days ago

  • Assignee set to Marnik Roosen
#5

Updated by Roel Standaert 16 days ago

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Marnik Roosen to Roel Standaert
  • % Done changed from 0 to 100
#6

Updated by Roel Standaert 16 days ago

  • Status changed from Implemented @Emweb to Resolved
#7

Updated by Roel Standaert 11 days ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF