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)
main
Dani Palou 2022-12-05 13:01:09 +01:00
parent 797b2a3690
commit 6f673ea561
1 changed files with 3 additions and 0 deletions

View File

@ -210,6 +210,9 @@ export class CoreExternalContentDirective implements AfterViewInit, OnChanges, O
if (tagName === 'SOURCE') { if (tagName === 'SOURCE') {
// Restoring original src. // Restoring original src.
this.addSource(url); 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'); throw new CoreError('Non-downloadable URL');