Skip to content

Commit 234cae7

Browse files
Merge pull request #2074 from amit-webkul/readme
Reverting the lookup component changes.
2 parents 28ed127 + b6ffea1 commit 234cae7

File tree

1 file changed

+14
-26
lines changed
  • packages/Webkul/Admin/src/Resources/views/components/attributes/edit

1 file changed

+14
-26
lines changed

packages/Webkul/Admin/src/Resources/views/components/attributes/edit/lookup.blade.php

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -139,43 +139,31 @@ class="px-4 py-2 text-center text-gray-500"
139139
};
140140
},
141141
142-
mounted() {
143-
this.initializeValue();
144-
145-
window.addEventListener('click', this.handleFocusOut);
146-
},
147-
148142
watch: {
149-
value: {
150-
deep: true,
151-
152-
handler() {
153-
this.initializeValue();
154-
},
155-
},
156-
157143
searchTerm(newVal, oldVal) {
158144
this.search();
159145
},
146+
147+
value(newVal, oldVal) {
148+
if (newVal) {
149+
this.getLookUpEntity();
150+
}
151+
},
152+
},
153+
154+
mounted() {
155+
if (this.value) {
156+
this.getLookUpEntity();
157+
}
158+
159+
window.addEventListener('click', this.handleFocusOut);
160160
},
161161
162162
beforeDestroy() {
163163
window.removeEventListener('click', this.handleFocusOut);
164164
},
165165
166166
methods: {
167-
initializeValue() {
168-
if (this.value) {
169-
if (this.value.id && this.value.name) {
170-
this.entityId = this.value.id;
171-
172-
this.selectedItem = this.value.name;
173-
} else if (this.value.id) {
174-
this.getLookUpEntity(this.value.id);
175-
}
176-
}
177-
},
178-
179167
toggle() {
180168
this.showPopup = ! this.showPopup;
181169

0 commit comments

Comments
 (0)