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

Feature request: Button to hide (toggle) the virtual keyboard inside the keyboard itself 🔽 #2416

Open
anisabboud opened this issue Jun 26, 2024 · 3 comments

Comments

@anisabboud
Copy link

When a math field is placed at the bottom of the screen or inside a dialog (such that it's not possible to scroll further down), opening the virtual keyboard (which opens onfocus by default on mobile) would hide the field itself, along with the virtual keyboard toggle.

In this case, there is no way for the user to hide the virtual keyboard unless they click outside the math field (blur).
It would be nice if a simple chevron arrow to hide the virtual keyboard was added at the top-right corner of the keyboard.

image

@anisabboud
Copy link
Author

anisabboud commented Jun 26, 2024

An alternative idea (more complicated) is for the keyboard to check the position of the mathfield (y coordinate), and if the field is in the bottom 250px of the screen, then to automatically move the entire keyboard to the top-most part of the screen (to avoid covering the mathfield).

@arnog
Copy link
Owner

arnog commented Jun 26, 2024

A couple of comments:

  • When a mathfield is focused (such as when tabbing through mathfields), it will be scrolled into view. If the mathfield is already focused however, it is not scrolled into view when the keyboard appears. Perhaps that's the behavior that should change.
  • When the keyboard is displayed, the height of the container is adjusted so that it is possible to scroll and reveal the mahtfield, even if it was at the very bottom of the page
  • There is an (optional) [hide-keyboard] keycap that can be added to keyboard layouts

@anisabboud
Copy link
Author

Thank you for the clarifications, @arnog!

Indeed, when the keyboard is displayed, you add padding-bottom: 313px to the <body> so that it is always possible to scroll and reveal the mathfield.

In my case however, the mathfield is inside a dialog (with position: fixed), making the <body> padding ineffective.
In the meantime, I worked around the issue with some CSS inspired by your solution:

body:has(> .ML__keyboard) dialog-container {
  padding-bottom: 300px;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants