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

Event geometrychange not fired when clicking on keyboard button to hide the virtual keyboard #2161

Closed
ybi55 opened this issue Oct 24, 2023 · 1 comment
Assignees
Labels

Comments

@ybi55
Copy link

ybi55 commented Oct 24, 2023

Here is the code of an html page to visualize the problem.
For me the mathlive version displayed in the console is 0.95.5
If you click on the keyboard button in the editor, an alert message appears (keyboard display status changed) and the virtual keyboard appears in a custom div as container : the geometry change event listener is launched.
If you click again on the keyboard button to hide the virtual keyboard, the virtual keyboard disappears but no alert message : the geometrychange event seems not to be fired.
The problem can bee seen on chrome, firefox or edge (windows 11).

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<p></p> <p id="editor">
    A = <MATH-FIELD></MATH-FIELD>
</p>
<div id="keyboardcontainer" style="position: absolute; left: 0px; top: 100px; width: 400px; height:300px">

</div>
<script type="module">
  window.addEventListener('DOMContentLoaded', () =>
    import('//unpkg.com/mathlive?module').then((mathlive) => {
        console.log(globalThis[Symbol.for('io.cortexjs.mathlive')].version);
        mathlive.renderMathInDocument()
        window.mathVirtualKeyboard.container = document.getElementById('keyboardcontainer')
        window.mathVirtualKeyboard.addEventListener('geometrychange', function (ev) {
          alert('keyboard display status changed')
        })
      }
    )
  )
</script>
</body>
</html>
</html>
@lhotejc
Copy link

lhotejc commented Nov 7, 2023

It seems that mathVirtualKeyboard do not extend the standard virtualKeyboard interface ?

virtualKeyboard interface is experimental technology in this mdn page.

what about the Mathlive mathVirtualKeyboard ?

what events it can fire ?

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

No branches or pull requests

3 participants