nativescript-webview-interface
nativescript-webview-interface copied to clipboard
callback not opening a modal
i can use a click inside of a webform to set an alert in my native component, but for some reason it doesn't open a modal with data. If I put a button on my page under the webview and call the exact same function, it opens and populated the modal.
I can console log the data so it is passing the data properly to the modal from the webview, but for some reason the view doesn't bind to the data. I also noticed when I click the nativescript button to call the modal, that modal goes through the lifecyle events but when calling it from the webview it only gets through the constructor.
Andy idea what I might need to do?
In my parent component with the webview I have this call to the modal component service:
openVocabModal(vocabid){
console.log('vocab id', vocabid);
const ctx =
this.myModalService.createModalContext<Object, string>(
this.vcRef,
'Vocab',
{vocabDef: "some definition", vocabTerm: 'some vocab term'}
)
this.myModalService.createModal(VocabModalComponent, ctx)
.then(res=>{
console.log(res);
});
}
Here is my call
listenVocabWebViewEvents(){
this.oVocabWebViewInterface.on('vocabTapped', (vocabid) => {
console.log("vocab tapped", vocabid);
this.openVocabModal(vocabid);
});
}
I have the similar issue