From 6f673ea561ff2560a69d57e6f660f99e863be717 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 5 Dec 2022 13:01:09 +0100 Subject: [PATCH] MOBILE-4081 external-content: Set attribute for untreated urls This fixes an issue when rendering images using directly the local URL (e.g. in image viewer) --- src/core/directives/external-content.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/directives/external-content.ts b/src/core/directives/external-content.ts index f62115f7b..68f0323e4 100644 --- a/src/core/directives/external-content.ts +++ b/src/core/directives/external-content.ts @@ -210,6 +210,9 @@ export class CoreExternalContentDirective implements AfterViewInit, OnChanges, O if (tagName === 'SOURCE') { // Restoring original src. this.addSource(url); + } else if (url && !this.element.getAttribute(targetAttr)) { + // By default, Angular inputs aren't added as DOM attributes. Add it now. + this.element.setAttribute(targetAttr, url); } throw new CoreError('Non-downloadable URL');