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

Carousel component causes rendering bugs in Chrome #1713

Open
itpropro opened this issue Apr 24, 2024 · 1 comment · May be fixed by #1714
Open

Carousel component causes rendering bugs in Chrome #1713

itpropro opened this issue Apr 24, 2024 · 1 comment · May be fixed by #1714
Labels
bug Something isn't working

Comments

@itpropro
Copy link
Sponsor

itpropro commented Apr 24, 2024

Environment

  • OS: Windows 11
  • Browser: Chrome/Edge latest

Version

Current

Reproduction

Description

The Carousel component causes rendering bugs on elements that have blur applied with a backdrop-filter.
This happens on every Chrome/Edge browser used on Windows on every page that uses the Carousel component. It can be seen in the Header component on the official Nuxt UI pages for the Carousel Docs and the Templates page:

BlurBug

The issue is caused by JS that is loaded by the Carousel component. The closest I came to the root cause was line 121 in the Carousel.vue file.
If this part

    useResizeObserver(carouselRef, (entries) => {
      const [entry] = entries

      itemWidth.value = entry?.target?.firstElementChild?.clientWidth || 0
    })

Is replaced by

    useResizeObserver(carouselRef, (entries) => {
      const [entry] = entries

      // itemWidth.value = entry?.target?.firstElementChild?.clientWidth || 0
    })

The rendering issue is gone. If itemWidth is set to anything else than 0, even statically, the artifact appears.

It would be great if someone could find out why this happens and how to fix this, as this impacts everyone who uses Chrome or Edge on Windows to consume a website, which is most of the world.

Additional context

No response

Logs

No response

@itpropro itpropro added the bug Something isn't working label Apr 24, 2024
@YIngChenIt YIngChenIt linked a pull request Apr 25, 2024 that will close this issue
8 tasks
@YIngChenIt
Copy link
Contributor

I found that the Carousel uses the 'mix-blend-overlay' CSS style property to enhance the visual effect of the indicators, but after multiple experiments, it was discovered that this property caused the issue.

Can we achieve the desired outcome by removing the use of this property, or if there are other good ideas, I am willing to provide assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants