arnog / mathlive

A web component for easy math input
https://cortexjs.io/mathlive
MIT License
1.26k stars 260 forks source link

Hide virtual keyboard always #2388

Closed kingfisherphuoc closed 4 weeks ago

kingfisherphuoc commented 4 weeks ago

Description

We want to hide the virtual keyboard always because we use other elements with commands instead. Is there any option to do so? I tried virtual-keyboard-toggle: off, but it seems not working.

Steps to Reproduce

(Required) Provide steps that are specific and repeatable

  1. Use math-field
  2. Style the keyboard:
    math-field::part(virtual-keyboard-toggle) {
          display: off;
    }
    <math-field id="formula" style="display: block">\frac{11}{101}</math-field>

Actual Behavior

(Required) What happened when you followed the steps above?"

The virtual keyboard still shows up when I touch the math-field.

Expected Behavior

(Required) What did you expect to happen instead? It may be obvious to you what should have happened, but if you don't state it explicitly it may not be obvious to others.

The virtual keyboard should remain hidden. It can be shown manually when we want.

Environment

Is this a regression: did it use to work in a previous version?

MathLive version
0.98.6

Operating System Android

Browser Webview

Screenshot_20240606_175313

arnog commented 4 weeks ago

To hide the virtual keyboard toggle see: https://cortexjs.io/mathlive/guides/virtual-keyboards/#controlling-the-virtual-toggle-visibility

To prevent the virtual keyboard from being displayed automatically, set the virtual keyboard policy to manual: mf.mathVirtualKeyboardPolicy = "manual";

kingfisherphuoc commented 4 weeks ago

@arnog thanks. You are right.