Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Navigator.keyboard.lock() icw requestFullscreen does not change behavior to 'Press and Hold Escape' #40342

Closed
3 tasks done
Micha3000 opened this issue Oct 26, 2023 · 0 comments · Fixed by #40365
Closed
3 tasks done

Comments

@Micha3000
Copy link

Preflight Checklist

Electron Version

27.0.2

What operating system are you using?

Windows

Operating System Version

Windows 10 Pro version 22H2

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

When an element is brought to fullscreen with:
elem.requestFullscreen()

and an event listener exists like:

document.addEventListener('fullscreenchange', async () => {
  const nav: any = navigator;

  const elem = document.getElementById('app');

  if (elem) {
    await nav.keyboard.lock(['Escape']);
    return;
  }
  nav.keyboard.unlock();
});

I would expect that the behavior of the Esc key changes, where I would now need to press and hold Esc for a few seconds before fullscreen is actually exited. As described here: https://developer.chrome.com/blog/better-full-screen-mode/
I imagine the same behavior change should hold for when requestPointerLock() is used.

Actual Behavior

When the Esc key is pressed after bringing an element to fullscreen, it ALWAYS exits fullscreen immediately, even when used in combination with keyboard.lock() API.

Testcase Gist URL

No response

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: 👍 Does Not Block Stable
Development

Successfully merging a pull request may close this issue.

3 participants