Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: scrollCanvas doens't work #5342

Closed
2 tasks done
wsaca opened this issue Aug 26, 2023 · 0 comments
Closed
2 tasks done

BUG: scrollCanvas doens't work #5342

wsaca opened this issue Aug 26, 2023 · 0 comments

Comments

@wsaca
Copy link

wsaca commented Aug 26, 2023

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

Firefox 116.0.3

Reproducible demo link

https://grapesjs.com/demo-mjml.html

Describe the bug

How to reproduce the bug?

  1. On the canvas scroll to the bottom and select a component
  2. Open the layers
  3. Select a component that is at the top of the canvas, scrolling doesn't work.

What is the expected behavior?
Scrolling should work.

What is the current behavior?
Scrolling doesn't work.

If is necessary to execute some code in order to reproduce the bug, paste it here below:

// your code here

The error could be in this line:
https://github.com/GrapesJS/grapesjs/blob/v0.21.4/src/canvas/view/FrameView.ts#L153

The function getOffsetRect is using:

const { scrollTop, scrollLeft } = this.getBody();

scrollTop and scrollLeft are always 0, it could be replaced with:

const { scrollTop, scrollLeft } =  this.getDoc().scrollingElement;

or

const { scrollTop, scrollLeft } =  this.getDoc().documentElement;

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant