Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/devui-vue/devui/mention/src/mention.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, ref, onMounted, watch, onUnmounted, nextTick, computed, getCurrentInstance } from 'vue';
import { defineComponent, ref, onMounted, watch, onUnmounted, computed, getCurrentInstance } from 'vue';
import { IMentionSuggestionItem, mentionProps, type MentionProps } from './mention-types';
import DTextarea from '../../textarea/src/textarea';
import DIcon from '../../icon/src/icon';
Expand Down Expand Up @@ -30,10 +30,10 @@ export default defineComponent({
if (props.trigger.includes(val[0])) {
showSuggestions.value = true;
if (props.position === 'top') {
nextTick(() => {
setTimeout(() => {
const height = window.getComputedStyle(suggestionsDom.value as Element, null).height;
suggestionsTop.value = -Number(height.replace('px', ''));
});
}, 0);
}
filteredSuggestions.value = (suggestions.value as IMentionSuggestionItem[]).filter((item: IMentionSuggestionItem) =>
String(item[props.dmValueParse.value as keyof IMentionSuggestionItem])
Expand Down