Skip to content

Commit 8b08474

Browse files
authored
Merge pull request #326 from devforth/AdminForth/785
feat: add teleportToTop prop and enhance dropdown rendering in Select…
2 parents 5786efc + 5443957 commit 8b08474

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

adminforth/spa/src/afcl/Select.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
/>
3737
</div>
3838
</div>
39-
<teleport to="body" v-if="teleportToBody && showDropdown">
40-
<div ref="dropdownEl" :style="getDropdownPosition" :class="{'shadow-none': isTop}"
41-
class="fixed z-[5] w-full bg-white shadow-lg dark:shadow-black dark:bg-gray-700
39+
<teleport to="body" v-if="(teleportToBody || teleportToTop) && showDropdown">
40+
<div ref="dropdownEl" :style="getDropdownPosition" :class="{'shadow-none': isTop, 'z-[5]': teleportToBody, 'z-[1000]': teleportToTop}"
41+
class="fixed w-full bg-white shadow-lg dark:shadow-black dark:bg-gray-700
4242
dark:border-gray-600 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm max-h-48"
4343
@scroll="handleDropdownScroll">
4444
<div
@@ -61,7 +61,7 @@
6161
</div>
6262
</teleport>
6363

64-
<div v-if="!teleportToBody && showDropdown" ref="dropdownEl" :style="dropdownStyle" :class="{'shadow-none': isTop}"
64+
<div v-if="!teleportToBody && !teleportToTop && showDropdown" ref="dropdownEl" :style="dropdownStyle" :class="{'shadow-none': isTop}"
6565
class="absolute z-10 mt-1 w-full bg-lightDropdownOptionsBackground shadow-lg text-lightDropdownButtonsText dark:shadow-black dark:bg-darkDropdownOptionsBackground
6666
dark:border-gray-600 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm max-h-48"
6767
@scroll="handleDropdownScroll">
@@ -143,6 +143,10 @@ const props = defineProps({
143143
type: Boolean,
144144
default: false,
145145
},
146+
teleportToTop: {
147+
type: Boolean,
148+
default: false,
149+
},
146150
});
147151
148152
const emit = defineEmits(['update:modelValue', 'scroll-near-end', 'search']);

0 commit comments

Comments
 (0)