editor: fix quirck on blur

This commit is contained in:
jean-emmanuel 2021-12-14 09:36:35 +01:00
parent cd50f76cb4
commit fc09b2d444
2 changed files with 7 additions and 6 deletions

View file

@ -179,14 +179,15 @@ class UiInspectorField extends UiWidget {
editor.setHighlightActiveLine(true)
editor.setHighlightGutterLine(true)
editor.removeAllListeners('blur')
editor.removeAllListeners('change')
editor.on('change', (e)=>{
input.value = editor.getValue()
})
editor.on('blur', (e)=>{
if (input.value !== editor.getValue()) {
input.value = editor.getValue()
this.parent.focusedInput = input
this.parent.onChange()
}
this.parent.focusedInput = input
editor.setHighlightActiveLine(false)
editor.setHighlightGutterLine(false)
this.parent.onChange()
})
})