FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: issue where image elements could end up in invalid render state · NativeScript/NativeScript@13711cd · GitHub

Commit 13711cd

Browse files
fix: issue where image elements could end up in invalid render state
When loading an image from a remote resource, all the background properties are applied before the imageSource. When assigning borderRadius to an image, then later setting its imageSource would cause the image to be in a bad render state and completely disappear from the UI. This patch clones the backgroundInternal property after async assignment of the imageSource.
1 parent 2f0d3b0 commit 13711cd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎tns-core-modules/ui/image/image-common.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export abstract class ImageBase extends View implements ImageDefinition {
7878
fromUrl(value).then((r) => {
7979
if (this["_url"] === value) {
8080
this.imageSource = r;
81+
// Clone the backgroundStyle to correct (now invalid?) background state.
82+
this.style.backgroundInternal = this.style.backgroundInternal.clone();
8183
this.isLoading = false;
8284
}
8385
});

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL