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