You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into some issues with the eslint vue rules, particularly vue/no-mutations-props:
Mutating a prop locally is now considered an anti-pattern, e.g. declaring a prop and then setting this.myProp = 'someOtherValue' in the component. Due to the new rendering mechanism, whenever the parent component re-renders, the child component’s local changes will be overwritten.
The issue are in clickKey and setFocusToInput methods: this.input.value = text (line 266) this.input.selectionStart = caret.start (286) this.input.selectionEnd = caret.end (line 287)
The workaround I made is the following:
I created an event listener on the parent component:
Hi all,
I ran into some issues with the eslint vue rules, particularly vue/no-mutations-props:
The issue are in clickKey and setFocusToInput methods:
this.input.value = text
(line 266)this.input.selectionStart = caret.start
(286)this.input.selectionEnd = caret.end
(line 287)The workaround I made is the following:
I created an event listener on the parent component:
In keyboard.vue, I replaced the above mentioned lines by:
this.input.value = text
=>this.$emit('update-form', { key: 'value', value: text })
this.input.selectionStart = caret.start
=>this.$emit('update-form', { key: 'selectionStart', value: caret.start })
this.input.selectionEnd = caret.end
=>this.$emit('update-form', { key: 'selectionEnd', value: caret.end })
Hope it serves other people!
The text was updated successfully, but these errors were encountered: