![ios – What may trigger a change occasion to not hearth in angular, when an equal DOM occasion listener does? ios – What may trigger a change occasion to not hearth in angular, when an equal DOM occasion listener does?](https://geeks-news.com/wp-content/uploads/https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=73d79a89bded)
[ad_1]
I’ve an angular software with a part with a file enter like so:
<enter #fileInput kind="file" (change)="uploadFile($occasion)" />
The part is shared throughout a number of elements of the appliance. In virtually all circumstances, this works precisely as anticipated. Nevertheless, on one web page of my software when utilizing the app in an iframe
in a WkWebView
within the Salesforce iOS app, the change
occasion doesn’t hearth if the person goes by way of the iOS “Take Photograph or Video” workflow that’s a part of the iOS implementation of file inputs. Different pages within the software can use the enter simply superb; different iOS apps can iframe the positioning and use this web page simply superb; utilizing an choice apart from “Take Photograph or Video” works simply superb.
What’s further unusual, is that if I connect a change
occasion to the ingredient natively, bypassing Angular, it really works simply superb:
@ViewChild('fileInput', { static: true }) fileInput: ElementRef;
ngAfterViewInit() {
this.fileInput.nativeElement.addEventListener('change', this.uploadFile);
}
One thing about this extraordinarily narrowly particular confluence of things causes the bug. After days of pouring over this and attempting to find the foundation trigger, I’m out of concepts. What may plausibly intervene with a change
occasion firing?
By the way, I’ve tried the tips to null
out the enter worth, as prompt in solutions like this one. It doesn’t assist right here.
[ad_2]