mirror of https://github.com/rancher/dashboard.git
Set CodeMirror `readonly` flag to `true` to enable copy (#14426)
This updates the `readonly` flag to `true` instead of `nocursor` when the CodeMirror component is in View mode. The copy event will not fire when type `ctrl + C` or `Command + C`; this stems from the fact that the editor never receives focus when `nocursor` is used. To resolve this issue, we can use a boolean value for `readonly` and ensure that the container focus is not set to true when in View mode to prevent help text from rendering. Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
This commit is contained in:
parent
4288c1008e
commit
c52840635e
|
|
@ -88,7 +88,7 @@ export default {
|
|||
|
||||
// fixes https://github.com/rancher/dashboard/issues/13653
|
||||
// we can't use the inert HTML prop on the parent because it disables all interaction
|
||||
out.readOnly = this.isDisabled ? 'nocursor' : false;
|
||||
out.readOnly = !!this.isDisabled;
|
||||
|
||||
return out;
|
||||
},
|
||||
|
|
@ -227,8 +227,8 @@ export default {
|
|||
},
|
||||
|
||||
onFocus() {
|
||||
this.isCodeMirrorFocused = true;
|
||||
this.$emit('onFocus', true);
|
||||
this.isCodeMirrorFocused = !this.isDisabled;
|
||||
this.$emit('onFocus', this.isCodeMirrorFocused);
|
||||
},
|
||||
|
||||
onBlur() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue