-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Custom JS keyboard #633
Comments
@loc-trinh If you want to prevent the default keyboard from appearing on mobile devices for a <div id="myEditableDiv" contenteditable="true" style="touch-action: none;"></div> In this example, the ![]() You can try the method mentioned above by encapsulating an Here's a simple react-codemirror/extensions/events/src/index.ts Lines 18 to 48 in 923c164
|
Thank you so much for the quick reply, I will give this a try. Update: this works!
Can you elaborate more on how to 'encapsulating an extension to add the touch-action: none; style to the div.cm-content'? I think I want to modify |
@loc-trinh, this is the most basic example extensions/events. This extension adds events to the div DOM node, allowing you to add properties to it. |
@loc-trinh I extended the import { element } from '@uiw/codemirror-extensions-events';
const extension3 = element({
type: 'content',
props: {
inputMode: 'none',
},
}); |
Wow you are fast, thank you! |
For coding on mobile app, I would like to use a custom keyboard instead of default iOS keyboard which is not good for coding.
For a textarea component, you can set
inputType='none'
to disable iOS keyboard from popping up. and with onHover or something I figure you probably can pull up a custom coding keyboard.I was wondering if it's possible to do
inputType='none'
for a CodeMirror instance somehow?The text was updated successfully, but these errors were encountered: