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: Update objectFit style as attribute on <Image /> #41787

Closed
wants to merge 4 commits into from

Conversation

yellosun
Copy link

Bug

As the working example of how to implement background images using next/image, I found that the current way this is written (the object-fit css property within a style tag) does not actually apply the style (on version ^12.3.1). So I thought it may be worth making a note either to the existing style as I listed above, or the inverse— where a note is left to explain objectFit must be written as its own attribute on the <Image /> component rather than within the style tag in order to apply correctly. Thanks!

ijjk and others added 3 commits October 25, 2022 08:05
As the working example of how to implement background images using next/image, I found that the current way this is written (the `object-fit` css property within a style tag) does not actually apply the style (on version ^12.3.1). So I thought it may be worth making a note either to the existing style as I listed above, or the inverse— where a note is left to explain objectFit must be written as its own attribute on the `<Image />` component rather than within the style tag in order to apply correctly. Thanks!
@balazsorban44
Copy link
Member

Thanks, but the current code is actually correct as Next.js 13 now does not have the objectFit prop anymore. Mentioned in the version history in the docs: https://nextjs.org/docs/api-reference/next/image

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants