Skip to content

Why does <Image> use CSS background-image and <img>? #1908

Discussion options

You must be logged in to vote

@okwast I think this is done to support resizeMode property. img tag is added for accessibility reasons. It renders on top of the background image, so we can get the alt attribute and browsers can show the image context menu.

// Accessibility image allows users to trigger the browser's image context menu

Found the above comment in the source code 😅

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@okwast
Comment options

Answer selected by okwast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1907 on February 15, 2021 17:33.