I am calling an LWC component on a quick-action click.
I get an infinite scroll (See image Link) when I reload the page without closing quick action.
See Image
LWC is not being loaded.
Related
So in my app, I create an additional page. When that page is opened, it will guide a user through a series of steps, that ultimately open a webview pointing to a URL in backend, that generates an image to be saved to the server. The user doesn't need to know what's being drawn in the webview, so the webview can be set invisible (opacity = 0.0).
The image can only be generated by that web page (which is why I have to open it with webview). This is a client-side javascript and HTML5 canvas process that can't be done by server-side code alone. There's actually a web page that has to be opened. And all the Flutter code need to do is to open the webview component long enough for the image to be created and automatically saved into the server.
The problem is, the process may take dozens of seconds. In my case, it takes like 7-12 seconds. And the user may press back on the page that unfortunately will close the webview too and cancel the image generation and submission. I already added an infinite circular progress indicator, but apparently, from the early user tests, some users weren't patient enough to wait that long and already pressed back before the image is finished rendering.
My question is, how can I create a webview detached from the current screen, so that even after the current screen is closed, the webview will still be running in the background?
Currently, I use flutter_webview_plugin: ^0.3.11 for this. It allows for launching webview popup that's hidden. But when I close the page, the invisible webview popup also gets closed too.
Combine Offstage widget with custom pop logic (instead of popping back, just hide the webview by setting bool offstage to true).
As per Offstage docs:
A widget that lays the child out as if it was in the tree, but without
painting anything, without making the child available for hit testing,
and without taking any room in the parent.
Offstage children are still active: they can receive focus and have
keyboard input directed to them.
Animations continue to run in offstage children, and therefore use
battery and CPU time, regardless of whether the animations end up
being visible.
https://api.flutter.dev/flutter/widgets/Offstage-class.html
I am working on an Ionic 3 application. Inside a div, i am loading an external url in an iframe and it is loading perfectly. But it creates problem when focuses out. The iframe reloads every time when it focuses out.
Scenario-01: In the page where i have loaded the iframe, there are other controls outside of the iframe such as a text box to enter some data. So, when i click on the textbox, the keyboard appears but at the same time iframe reloads again.
Scenario-02: I have one menu sliding drawer from left in the application. When i open the sliding drawer to select another page, i could see the iframe of the existing page reloads again.
Scenario-03: The external url that i have loaded in the iframe has some input controls. So, i want to enter something in those input boxes, the keyboard appears but at the same time iframe gets reloaded and i could not provide any data in those input boxes.
From my assumption, iframe is causing problems when it focuses out. So, i tried to capture the blur event of that iframe and try to stop the propagation of the event.
<iframe width="100%" height="100%" [src]="url| safeHtml:'resourceUrl'" (ionBlur)="checkBlur($event)" (ionFocus)="checkFocus($event)"></iframe>
But, both ionFocus and ionBlur events were not triggering.
For now, when i tried with Android application, all the scenarios trigger iframe reload. As keyboard does not appears in browser, when i tried with Browser, only Scenario-02 triggers iframe reload.
Iframe should load at the first time only. Then user can do whatever operations inside the iframe or outside the iframe but the iframe should not load again.
How to stop reloading the iframe if it focuses out by keyboard or sliding drawer or anything?
I figured out the solution. The problem was with the safeHtml:'resourceUrl' pipe. It was sanitizing every time iframe comes in focus and prepared a new ResourceURL. As a result, iframe gets reloaded each time.
So, i sanitized the url beforehand in the ts and set it to the variable. As a result, iframe is not reloading anymore. I have used DomSanitizer to sanitize the resource url.
url: any;
constructor(private domSanitizer: DomSanitizer) {
this.url= this.getSantizedURL();
}
getSantizedURL() {
this.domSanitizer.bypassSecurityTrustResourceUrl(mySampleURL);
}
I am trying to build a carousel where a user can personalize each slide. Out of box carousel does not seem to do it.
The solution I end up doing was to extend the parsys and keep the virtual 3cols. I renamed the 3cols to carousel and added a custom attribute called renderType and set it to "carousel". So when parsys tries to render, knowing it is carousel I render as carousel instead of regular content holder.
It works but then I would like call a javascript when a user clicks "Preview" so that I can render this as carousel and when they unchoose "Preview" by clicking Edit or Target, I would render normally.
I see that you can listen to WCMMode change event but I am not able to get concrete e.g or documentation to perform. Any help?
I have a page hosted on, say, www.domainX.com. In my page there is an iframe, src attribute of which is set to www.domainY.com (so it's on another domain). There are some links on the page served from www.domainY.com (so they show up in the iframe). When I click one of these links there happens the navigation inside the iframe. Now, when I move the cursor on iframe, right-click and select 'Back' on the appearing menu, it makes a back in the inner iframe. If I do the same thing again, it does a back on the main window, as if I pressed the back button of the browser (or I right-clicked out of the iframe and selected 'Back').
My problem is: I am OK with back navigations in the iframe, but I do not want them to bubble up to the main window. I can alter the source code of the page on www.domainX.com, but I don't have access to the source code of the page on www.domainY.com . I tried attaching an 'onback' handler on the iframe element, which stops the event propagation; but it did not work. Any pointers will be appreciated.
Thanks
Here is my problem:
I have successfully included the Facebook Like button on my test page. There are several items per page and there is a facebook like button per item. I am using the XFBML version.
Everything runs fine if the buttons are present in the page on load. However, Now I want to show the buttons per item only on mouseover on the container element having the item and the button.So, the fblike button html is hidden on page load and I added some code like this to show them on mouse-hover:
$(content).mouseenter(function(){
$(this).find('.fblike').show(); // toggle the display of the button
FB.XFBML.parse( this ); //re-parse xfbml
});
The button shows up perfectly on mouse-hover on the container now but never works. Clicking the button doesn't do anything.
Has anyone run across this problem before ?
EDIT:
.fblike is a class on a div containing the fb:like tag.
Re-parsing is required because on page-load, each div with the class .fblike is hidden. The Facebook JavaScript SDK doesn't parse the xfbml tags inside elements which are hidden.
I think you problem is in this variable scope. Try this:
FB.XFBML.parse($(this));
Because you don't need this (anonymous function being called) but element (on which this anonymous function was called).