File tree 2 files changed +16
-0
lines changed
packages/react-lightning/src/element 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @plexinc/react-lightning " : patch
3
+ ---
4
+
5
+ Adds support for svgs that use data urls
Original file line number Diff line number Diff line change @@ -29,6 +29,17 @@ export class LightningImageElement extends LightningViewElement<
29
29
30
30
public set src ( v ) {
31
31
this . node . src = v ;
32
+
33
+ // Attempt to set the svg imageType for data urls if not already set.
34
+ // Lightning doesn't handle svgs that are data urls, so this adds support
35
+ // for that.
36
+ if ( this . node . imageType == null && v ) {
37
+ const src = v . toLowerCase ( ) ;
38
+ const isSvg =
39
+ src . endsWith ( '.svg' ) || src . startsWith ( 'data:image/svg+xml,' ) ;
40
+
41
+ this . setNodeProp ( 'imageType' , isSvg ? 'svg' : null ) ;
42
+ }
32
43
}
33
44
34
45
protected override _handleTextureLoaded ( event : NodeLoadedPayload ) : void {
You can’t perform that action at this time.
0 commit comments