mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-31 19:17:48 +00:00
fix: Turn off FOCUS_CUSTOM_ATTRIBUTE event to avoid memory leak (#6772)
This commit is contained in:
@@ -218,13 +218,17 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.editedValue = this.formattedValue;
|
this.editedValue = this.formattedValue;
|
||||||
bus.$on(BUS_EVENTS.FOCUS_CUSTOM_ATTRIBUTE, focusAttributeKey => {
|
bus.$on(BUS_EVENTS.FOCUS_CUSTOM_ATTRIBUTE, this.onFocusAttribute);
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
bus.$off(BUS_EVENTS.FOCUS_CUSTOM_ATTRIBUTE, this.onFocusAttribute);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onFocusAttribute(focusAttributeKey) {
|
||||||
if (this.attributeKey === focusAttributeKey) {
|
if (this.attributeKey === focusAttributeKey) {
|
||||||
this.onEdit();
|
this.onEdit();
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
focusInput() {
|
focusInput() {
|
||||||
if (this.$refs.inputfield) {
|
if (this.$refs.inputfield) {
|
||||||
this.$refs.inputfield.focus();
|
this.$refs.inputfield.focus();
|
||||||
|
|||||||
Reference in New Issue
Block a user