antvis/G6

G6 creates canvas elements with style position: fixed #5031

lfkpoa posted onGitHub

Describe the bug

Hello,

There seems to be a problem in Beta 5 regarding the position of the canvas elements. They are being created with position: fixed, which makes their position fixed with regards to the screen. I think the correct would be position: absolute, which makes their position fixed with regards to the parent container. It ends up staying at a fixed place on the page instead of scrolling with the page. And I think something is wrong when detecting the container height too.

Your Example Website or App

https://zhcfkr.csb.app/

Steps to Reproduce the Bug or Issue

  1. open https://zhcfkr.csb.app/
  2. resize the window

Expected behavior

I would expect the canvas to scroll with the page

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Chrome
  • Version: 117.0.5938.63 64 bits

Additional context

No response


hi @lfkpoa, welcome!

posted by github-actions[bot] over 1 year ago

Hi @lfkpoa, Please star this repo if you find it useful! Thanks :star:! 你好 @lfkpoa。如果该仓库对你有用,可以 star 一下,感谢你的 :star:!

posted by github-actions[bot] over 1 year ago

The page is based on the webgl 3d example. The sandbox is https://codesandbox.io/s/youthful-oskar-zhcfkr

posted by lfkpoa over 1 year ago

Since $container already has position: relative, we should use absolute instead of fixed here.

posted by xiaoiver over 1 year ago

pls try 5.0.0-beta.20, issue fixed. And its new features:

posted by Yanyan-Wang over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests