fix: Fix RLC and select dropdown styling and functionality (no-changelog) (#6809)

* fix: fix RLC and select dropdown styling and functionality

* fix: change setTimeout to nextTick

* fix: fix resource locator padding
This commit is contained in:
Alex Grozav
2023-08-01 17:58:25 +03:00
committed by GitHub
parent 24ce141815
commit 88156deb5c
4 changed files with 60 additions and 33 deletions

View File

@@ -1,13 +1,12 @@
<template>
<n8n-popover
:teleported="false"
placement="bottom"
:teleported="false"
:width="width"
:popper-class="$style.popover"
:visible="show"
trigger="manual"
data-test-id="resource-locator-dropdown"
v-on-click-outside="onClickOutside"
>
<div :class="$style.messageContainer" v-if="errorView">
<slot name="error"></slot>
@@ -215,9 +214,6 @@ export default defineComponent({
onFilterInput(value: string) {
this.$emit('filter', value);
},
onClickOutside() {
this.$emit('hide');
},
onItemClick(selected: string) {
this.$emit('update:modelValue', selected);
},
@@ -249,16 +245,17 @@ export default defineComponent({
},
},
watch: {
show(toShow) {
if (toShow) {
show(value) {
if (value) {
this.hoverIndex = 0;
this.showHoverUrl = false;
setTimeout(() => {
if (value && this.filterable && this.$refs.search) {
(this.$refs.search as HTMLElement).focus();
}
}, 0);
}
setTimeout(() => {
if (toShow && this.filterable && this.$refs.search) {
(this.$refs.search as HTMLElement).focus();
}
}, 0);
},
loading() {
setTimeout(() => this.onResultsEnd(), 0); // in case of filtering
@@ -270,7 +267,7 @@ export default defineComponent({
<style lang="scss" module>
:root .popover {
--content-height: 236px;
padding: 0;
padding: 0 !important;
border: var(--border-base);
display: flex;
max-height: calc(var(--content-height) + var(--spacing-xl));