print is async(). In Firefox, cleanUp was resulting in a blank print preview page. …#538
print is async(). In Firefox, cleanUp was resulting in a blank print preview page. …#538scottgroovez wants to merge 1 commit intocrabbly:masterfrom
Conversation
…This small delay fixes it.
|
Just a comment from a complete outsider and maybe just personal preference but I think it would be good to add a comment in the code (basically the same as the PR description). That way it is way easier to understand why the delay is present even without using |
|
hi ... I am just commenting for this purpose that The issue which is coming in the Firefox, the file is previewing with the blank page in the Firefox browser How much time it take to resolve the issue |
this pull request is not working . I tried it in my project but is not working |
|
@abdullah-tahir-exodevs did you first build the files, the change is in the source files which are independent of the files in the dist directory, you can confirm by adding console log, like below. The file I am referring to is function performPrint(iframeElement, params) {
try {
iframeElement.focus(); // If Edge or IE, try catch with execCommand
if (_browser__WEBPACK_IMPORTED_MODULE_0__["default"].isEdge() || _browser__WEBPACK_IMPORTED_MODULE_0__["default"].isIE()) {
try {
iframeElement.contentWindow.document.execCommand('print', false, null);
} catch (e) {
iframeElement.contentWindow.print();
}
} else {
// Other browsers
iframeElement.contentWindow.print();
}
} catch (error) {
params.onError(error);
} finally {
if (_browser__WEBPACK_IMPORTED_MODULE_0__["default"].isFirefox()) {
// Move the iframe element off-screen and make it invisible
iframeElement.style.visibility = 'hidden';
iframeElement.style.left = '-1px';
}
console.log("cleaningup");
setTimeout(() => Object(_functions__WEBPACK_IMPORTED_MODULE_1__["cleanUp"])(params), 100);
}
}Failed to upload image, will update comment as soon as i can |
…This small delay fixes it.