Project

General

Profile

Actions

Bug #11207

closed

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

Added by Emeric Poupon over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Roel Standaert
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?

Actions #1

Updated by Roel Standaert over 1 year ago

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

Updated by Roel Standaert over 1 year ago

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

Updated by Roel Standaert over 1 year ago

  • Assignee deleted (Korneel Dumon)
Actions #4

Updated by Marnik Roosen over 1 year ago

  • Assignee set to Marnik Roosen
Actions #5

Updated by Roel Standaert over 1 year ago

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

Updated by Roel Standaert over 1 year ago

  • Status changed from Implemented @Emweb to Resolved
Actions #7

Updated by Roel Standaert about 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF