Merge pull request 'fix: use popup evt to handle loading' (!1738) from fix_vnselect_scroll into dev
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #1738 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
acc80aa036
|
@ -161,7 +161,7 @@ const arrayData = useArrayData(arrayDataKey, {
|
||||||
searchUrl: false,
|
searchUrl: false,
|
||||||
mapKey: $attrs['map-key'],
|
mapKey: $attrs['map-key'],
|
||||||
});
|
});
|
||||||
|
const isMenuOpened = ref(false);
|
||||||
const computedSortBy = computed(() => {
|
const computedSortBy = computed(() => {
|
||||||
return $props.sortBy || $props.optionLabel + ' ASC';
|
return $props.sortBy || $props.optionLabel + ' ASC';
|
||||||
});
|
});
|
||||||
|
@ -186,7 +186,9 @@ onMounted(() => {
|
||||||
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
|
if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
const someIsLoading = computed(() => isLoading.value || !!arrayData?.isLoading?.value);
|
const someIsLoading = computed(
|
||||||
|
() => (isLoading.value || !!arrayData?.isLoading?.value) && !isMenuOpened.value,
|
||||||
|
);
|
||||||
function findKeyInOptions() {
|
function findKeyInOptions() {
|
||||||
if (!$props.options) return;
|
if (!$props.options) return;
|
||||||
return filter($props.modelValue, $props.options)?.length;
|
return filter($props.modelValue, $props.options)?.length;
|
||||||
|
@ -369,6 +371,8 @@ function getCaption(opt) {
|
||||||
:input-debounce="useURL ? '300' : '0'"
|
:input-debounce="useURL ? '300' : '0'"
|
||||||
:loading="someIsLoading"
|
:loading="someIsLoading"
|
||||||
@virtual-scroll="onScroll"
|
@virtual-scroll="onScroll"
|
||||||
|
@popup-hide="isMenuOpened = false"
|
||||||
|
@popup-show="isMenuOpened = true"
|
||||||
@keydown="handleKeyDown"
|
@keydown="handleKeyDown"
|
||||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
||||||
:data-url="url"
|
:data-url="url"
|
||||||
|
|
Loading…
Reference in New Issue