2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-23 09:54:28 -06:00

Fix #399 autofocus property

This commit is contained in:
Jeroen Akkerman 2022-04-04 15:45:12 +02:00
parent 57f72bd5ae
commit 16f2dde59d
2 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- URLs with certain characters entered through prompts causing invalid markdown (Thanks to [@Zignature], [#393]).
- Autofocus option not working properly ([#399]).
## [2.16.1] - 2022-01-14
### Fixed
@ -228,6 +229,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
- Cursor not always showing in "text" mode over the edit field
<!-- Linked issues -->
[#399]: https://github.com/Ionaru/easy-markdown-editor/issues/399
[#252]: https://github.com/Ionaru/easy-markdown-editor/issues/252
[#251]: https://github.com/Ionaru/easy-markdown-editor/issues/251
[#239]: https://github.com/Ionaru/easy-markdown-editor/issues/239

View File

@ -2242,6 +2242,10 @@ EasyMDE.prototype.render = function (el) {
this.gui.sideBySide = this.createSideBySide();
this._rendered = this.element;
if (options.autofocus === true || el.autofocus) {
this.codemirror.focus();
}
// Fixes CodeMirror bug (#344)
var temp_cm = this.codemirror;
setTimeout(function () {