Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
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
4 changes: 4 additions & 0 deletions examples/css/darktheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ tr.jsoneditor-selected {
}

div.jsoneditor-field[contenteditable=true]:focus,
div.jsoneditor-field[contenteditable=plaintext-only]:focus,
div.jsoneditor-field[contenteditable=true]:hover,
div.jsoneditor-field[contenteditable=plaintext-only]:hover,
div.jsoneditor-value[contenteditable=true]:focus,
div.jsoneditor-value[contenteditable=plaintext-only]:focus,
div.jsoneditor-value[contenteditable=true]:hover,
div.jsoneditor-value[contenteditable=plaintext-only]:hover,
div.jsoneditor-field.jsoneditor-highlight,
div.jsoneditor-value.jsoneditor-highlight {
background-color: #808080;
Expand Down
4 changes: 2 additions & 2 deletions src/js/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,7 @@ export class Node {
if (domField) {
if (this.fieldEditable) {
// parent is an object
domField.contentEditable = this.editable.field
domField.contentEditable = this.editable.field ? 'plaintext-only' : false
Comment thread
josdejong marked this conversation as resolved.
Outdated
domField.spellcheck = false
domField.className = 'jsoneditor-field'
} else {
Expand Down Expand Up @@ -2428,7 +2428,7 @@ export class Node {
} else {
// create an editable or read-only div
domValue = document.createElement('div')
domValue.contentEditable = this.editable.value
domValue.contentEditable = this.editable.value ? 'plaintext-only' : false
domValue.spellcheck = false
domValue.innerHTML = this._escapeHTML(this.value)
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/treemode.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ treemode.getName = function () {
* - to the first button in the top menu
*/
treemode.focus = function () {
let input = this.scrollableContent.querySelector('[contenteditable=true]')
let input = this.scrollableContent.querySelector('[contenteditable=true]') || this.scrollableContent.querySelector('[contenteditable=plaintext-only]')
Comment thread
josdejong marked this conversation as resolved.
Outdated
if (input) {
input.focus()
} else if (this.node.dom.expand) {
Expand Down
4 changes: 4 additions & 0 deletions src/scss/jsoneditor/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,13 @@ a.jsoneditor-value.jsoneditor-url:focus {
color: variables.$jse-number;
}
div.jsoneditor-field[contenteditable="true"]:focus,
div.jsoneditor-field[contenteditable="plaintext-only"]:focus,
div.jsoneditor-field[contenteditable="true"]:hover,
div.jsoneditor-field[contenteditable="plaintext-only"]:hover,
div.jsoneditor-value[contenteditable="true"]:focus,
div.jsoneditor-value[contenteditable="plaintext-only"]:focus,
div.jsoneditor-value[contenteditable="true"]:hover,
div.jsoneditor-value[contenteditable="plaintext-only"]:hover,
div.jsoneditor-field.jsoneditor-highlight,
div.jsoneditor-value.jsoneditor-highlight {
background-color: variables.$jse-busy;
Expand Down