FlamedDogo99 / EaglerMobile

A userscript that allows EaglerCraft to run on mobile browsers. As of June 15, 2023, the Eagler Mobile script is directly integrated with the main EaglerCraft website!
Apache License 2.0
18 stars 20 forks source link

[Bug] Enter key does not work in keyboard compatibility mode #18

Closed FlamedDogo99 closed 4 months ago

FlamedDogo99 commented 4 months ago

Describe the Bug Related to #13 When using input events, nothing is dispatched when pressing the return key

Fix Wrap hiddenInput with a form that uses onSubmit

<form onsubmit="keyEvent('return', 'keydown')">
  <input type="text", id="hiddenInput">
  <input type="submit", style="opacity: 0">
</form>

Steps to Reproduce

  1. Start EaglerCraft client with Eagler Mobile
  2. Set window.keyboardFix to true
  3. Join a server or create a new world
  4. Press the chat 💬 button on the top row of buttons
  5. Press the keyboard ⌨️ button on the top row of buttons
  6. Note that pressing the enter key does not comment anything

Additional Information This issue will occur on any device when window.keyboardFix == true

FlamedDogo99 commented 4 months ago

Using beforeinput event listener with inputType insertLineBreak is much easier.

FlamedDogo99 commented 4 months ago

This has been fixed