mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-08-15 18:45:06 +00:00
[fix] Encode URL in background-image CSS property
Solution based on https://stackoverflow.com/questions/25613552/how-should-i-escape-image-urls-for-css Close #2286
This commit is contained in:
committed by
Nicolas Gallagher
parent
cb8381af7b
commit
91fc3c7aab
+1
-1
@@ -193,7 +193,7 @@ const Image: React.AbstractComponent<ImageProps, React.ElementRef<typeof View>>
|
||||
const selectedSource = shouldDisplaySource ? source : defaultSource;
|
||||
const displayImageUri = resolveAssetUri(selectedSource);
|
||||
const imageSizeStyle = resolveAssetDimensions(selectedSource);
|
||||
const backgroundImage = displayImageUri ? `url("${displayImageUri}")` : null;
|
||||
const backgroundImage = displayImageUri ? `url("${encodeURI(displayImageUri)}")` : null;
|
||||
const backgroundSize = getBackgroundSize();
|
||||
|
||||
// Accessibility image allows users to trigger the browser's image context menu
|
||||
|
||||
Reference in New Issue
Block a user