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

add two options inputStyle and nativeSpellcheck #143

Merged
merged 5 commits into from
Jan 26, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ easyMDE.value('New input for **EasyMDE**');
- **shortcuts**: Keyboard shortcuts associated with this instance. Defaults to the [array of shortcuts](#keyboard-shortcuts).
- **showIcons**: An array of icon names to show. Can be used to show specific icons hidden by default without completely customizing the toolbar.
- **spellChecker**: If set to `false`, disable the spell checker. Defaults to `true`.
- **inputStyle**: `textarea` or `contenteditable`. Defaults to `textarea` for desktop and `contenteditable` for mobile. `contenteditable` option is necessarry for enable nativeSpellcheck.
firm1 marked this conversation as resolved.
Show resolved Hide resolved
- **nativeSpellcheck**: If set to `false`, disable native spell checker. Defaults to `true`.
- **status**: If set to `false`, hide the status bar. Defaults to the array of built-in status bar items.
- Optionally, you can set an array of status bar items to include, and in what order. You can even define your own custom status bar items.
- **styleSelectedText**: If set to `false`, remove the `CodeMirror-selectedtext` class from selected lines. Defaults to `true`.
Expand Down
2 changes: 2 additions & 0 deletions src/js/easymde.js
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,8 @@ EasyMDE.prototype.render = function (el) {
placeholder: options.placeholder || el.getAttribute('placeholder') || '',
styleSelectedText: (options.styleSelectedText != undefined) ? options.styleSelectedText : !isMobile(),
configureMouse: configureMouse,
inputStyle: (options.inputStyle != undefined) ? options.inputStyle : (!isMobile()) ? 'textarea' : 'contenteditable',
firm1 marked this conversation as resolved.
Show resolved Hide resolved
spellcheck: (options.nativeSpellcheck != undefined) ? options.nativeSpellcheck : true,
});

this.codemirror.getScrollerElement().style.minHeight = options.minHeight;
Expand Down