From 7f52dc3c2aaeacfa615082feef40a407eac8444a Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Fri, 6 Jan 2017 14:34:46 +0200 Subject: [PATCH] Fix: Resetting backgroundImage throws --- tns-core-modules/ui/core/view-common.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tns-core-modules/ui/core/view-common.ts b/tns-core-modules/ui/core/view-common.ts index 3c7b0879d..fd7e9f80b 100644 --- a/tns-core-modules/ui/core/view-common.ts +++ b/tns-core-modules/ui/core/view-common.ts @@ -1480,6 +1480,11 @@ export const backgroundImageProperty = new CssProperty({ let url: string = newValue; let isValid = false; + if (url === undefined){ + style.backgroundInternal = currentBackground.withImage(undefined); + return; + } + let match = url.match(pattern); if (match && match[2]) { url = match[2];