fix: use different logic for buefy/oruga for product lookup keydown

i could have swore the new logic worked with buefy..but today it didn't
This commit is contained in:
Lance Edgar 2024-06-18 15:04:05 -05:00
parent 0212e52b66
commit 88e7d86087

View file

@ -56,7 +56,11 @@
<b-field grouped>
<b-input v-model="searchTerm"
ref="searchTermInput" />
ref="searchTermInput"
% if not request.use_oruga:
@keydown.native="searchTermInputKeydown"
% endif
/>
<b-button class="control"
type="is-primary"
@ -243,8 +247,10 @@
lookupShowDialog: false,
searchTerm: null,
searchTermInputElement: null,
searchTermLastUsed: null,
% if request.use_oruga:
searchTermInputElement: null,
% endif
searchProductKey: true,
searchVendorItemCode: true,
@ -259,14 +265,18 @@
}
},
mounted() {
this.searchTermInputElement = this.$refs.searchTermInput.$el.querySelector('input')
this.searchTermInputElement.addEventListener('keydown', this.searchTermInputKeydown)
},
% if request.use_oruga:
beforeDestroy() {
this.searchTermInputElement.removeEventListener('keydown', this.searchTermInputKeydown)
},
mounted() {
this.searchTermInputElement = this.$refs.searchTermInput.$el.querySelector('input')
this.searchTermInputElement.addEventListener('keydown', this.searchTermInputKeydown)
},
beforeDestroy() {
this.searchTermInputElement.removeEventListener('keydown', this.searchTermInputKeydown)
},
% endif
methods: {