I'm recently use element.requestFullScreen()
to enter full screen mode from my div. However, in my full screen view there's a button could trigger upload file function.
Is it possible for me to force stay in full screen mode while default select file window pop up?
simple demo in steps with jsfiddle 1. click full screen button to full screen mode 2. click file upload input
https://jsfiddle.net/56yzokra/3/
Thanks for reminding me for a simple demo to make it clear
I was facing this problem today, and my solution (may be not the best) was to triggers the fullscreen mode on the change event on the input file:
jQuery('#input[type="file"]').change(function(){
if (!document.fullscreenElement) {
var p = document.getElementById('process_container').requestFullscreen()
.then(console.log('full'))
.catch(error => {
console.log(error);
});
}
});
When the user selects a file to upload, then the DIV that was on fullscreen at first, is added on fullscreen once again. On my case, the input was on a modal, so the modal keeps open when this happens
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With