Fix: setCursor doesn't work well with inputStyle: "contenteditable",
#6168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: #6167
This PR fix
ContentEditableInput.showSelection(info)
, I removed takeFocus because it always false. It is a remanent code, it cannot work like that.Also, I add a demo page to try the spellchecker (and also, because I discovered that we can active the spellchecker only with stackoverflow, not with the codemirror documentation....).
My last change is to add
options.forceFocus
because the behavior of selection in theContenteditableInput
editor with no focus is weird and different of the behavior that we get withTextareaInput
.Q/A
Q/A
setSelection
To test my PR/fix you have to go on
demo/abc.html
and try to do :editor.setSelection({line:0, ch:2}, {line:0, ch:5})
editor.setCursor({line:0, ch:2})
Try each time with focus (--> click in the editor) and without no focus (--> click out of the editor, in the page)
Q/A
options.forceFocus
To test
options.forceFocus
:demo/abc.html
page, like this:editor.setSelection({line:0, ch:2}, {line:0, ch:5})
, nothing should be change.editor.setSelection({line:0, ch:2}, {line:0, ch:5}, {forceFocus:true})
, selection should be visible, like this:We have a visual difference between contenteditable and textarea InputStyle: