Skip to content

Blur placeholder stay visible with JavaScript disabled #28251

@hlubek

Description

@hlubek

What version of Next.js are you using?

11.1.0

What version of Node.js are you using?

12.22.1

What browser are you using?

Chrom, Firefox, Safari

What operating system are you using?

macOS

How are you deploying your application?

next dev, next start

Describe the Bug

When rendering an image with next/image that has a blur placeholder set:
If JavaScript is disabled in the browser, the img tag with blur placeholder as a background is shown on top of the noscript image. See this screenshot:

nextjs-img-placeholder-noscript

And this is the DOM showing that the later img overlaps the noscript img:

nextjs-img-placeholder-dom

We could solve this with some CSS trickery like:

noscript + img[data-nimg] {
    visibility: hidden;
}

But I think it would be best to change the order of both elements (but it's not clear to me if the order is on purpose here).

Expected Behavior

No blur placeholder should be visible when images are loaded with JavaScript disabled.

To Reproduce

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions