nocode-js/sequential-workflow-designer

Y-Scroll offset for step container

Closed this issue · 2 comments

Hi @b4rtaz ,

There is an issue I found with y-scroll for the loop (container step). It seems to come from the region-view@resolveClick.

The fix only does Y-Scroll (offset).

Here is my purposed fix

// fix: const regionOffsetPosition = new Vector(regionPosition.x, regionPosition.y + window.scrollY);

public resolveClick(click: ClickDetails): boolean {
    const regionPosition = this.getClientPosition();
    const regionOffsetPosition = new Vector(regionPosition.x, regionPosition.y + window.scrollY);
    const d = click.position.subtract(regionOffsetPosition);
    return d.x >= 0 && d.y >= 0 && d.x < this.width * click.scale && d.y < this.height * click.scale;
}

Please let me know if this can be pushed to version 0.17.1 or if you have something else in mind?

Thank you,
Ahsan

bug-scroll.mov
fix-scroll.mov

Hello @ziaahsan! Nice catch! Your fix is great, but the problem occurs in other components as well so I fixed it in a bit other way. Please check the 0.18.0 version.

Hi @b4rtaz,

That's awesome, thank you 🙏!

Confirmed PR and fix for v0.18.0.

Best,
Ahsan