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

Auto complete don't work on mobile #7054

Open
ghost opened this issue Aug 17, 2023 · 0 comments
Open

Auto complete don't work on mobile #7054

ghost opened this issue Aug 17, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Aug 17, 2023

Hi,
I am facing problem in code mirror on mobile, I tried to enable auto complete but ot doesn't work, I saw that I have to "Ctrl-Space" to activate it but in mobile we don't have "Alt" key, but in this link :

The auto complete works on the first code of block on mobile, How to do this?

As a brief:

auto complete don't work on mobile

I use a webview for android
And I used JavaScript and it's my code for webview:
<!DOCTYPE html>
<html>
<head>

<link rel="stylesheet" href="lib/codemirror.css">

</head>
<style>
    #myTextArea {
  width: 100%;    /* Take up 100% of available width */
  height: 100vh;  /* Take up 100% of viewport height */
  border: none;   /* Remove border for seamless appearance */
}

</style>
<body>
  <!-- Your CodeMirror initialization code will go here -->
  <!-- Inside the <body> section of codemirror.html -->
    <textarea id="codeEditor"></textarea>

<script>
//var myTextArea = document.getElementById("myTextArea");

var codeMirror = CodeMirror(document.getElementById("codeEditor"), {
  mode: "javascript",
  lineNumbers: true,
  theme: "darcula",
  extraKeys: {
    "Space": "autocomplete"
  },
  hintOptions: {
    completeSingle: false,
    alignWithWord: true,
    closeCharacters: /[\s()\[\]{};:>,]/
  }
});
document.addEventListener("DOMContentLoaded", function() {
  var codemirror = document.querySelector(".CodeMirror");
  codemirror.CodeMirror.setOption("extraKeys", {
    "Enter": function(cm) {
      cm.showHint({ hint: CodeMirror.hint.auto });
    }
  });
});
</script>
      <script src="src/codemirror.js"></script>
      <script src="mode/javascript/javascript.js"></script>
      <script src="addon/hint/show-hint.js"></script>
      <script src="addon/hint/javascript-hint.js"></script> <!-- For JavaScript autocomplete -->
</body>
</html>

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

0 participants