forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(next/image): inherit parent visibility (vercel#20542)
This PR is an alternative to vercel#20247 which contains tests for the expected behavior. --- Fixes vercel#20198 Closes vercel#20247
- Loading branch information
Showing
3 changed files
with
89 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
test/integration/image-component/default/pages/hidden-parent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Image from 'next/image' | ||
import React from 'react' | ||
|
||
const Page = () => { | ||
return ( | ||
<div> | ||
<p>Hello World</p> | ||
<div style={{ visibility: 'hidden' }}> | ||
<Image | ||
id="hidden-image" | ||
src="/test.jpg" | ||
width="400" | ||
height="400" | ||
></Image> | ||
</div> | ||
<p id="stubtext">This is the hidden parent page</p> | ||
</div> | ||
) | ||
} | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters