bug fixes, and performance improvements, and drawer
This commit is contained in:
@@ -7,14 +7,16 @@ const props = defineProps<{
|
||||
const { show, hide } = useTooltip();
|
||||
const triggerRef = ref<HTMLElement | null>(null);
|
||||
|
||||
const hasCursor = ref(false);
|
||||
|
||||
onMounted(() => {
|
||||
hasCursor.value = window.matchMedia('(hover: hover) and (pointer: fine)').matches;
|
||||
});
|
||||
let hasCursor: boolean | null = null;
|
||||
const checkHasCursor = () => {
|
||||
if (hasCursor === null && typeof window !== 'undefined') {
|
||||
hasCursor = window.matchMedia('(hover: hover) and (pointer: fine)').matches;
|
||||
}
|
||||
return hasCursor ?? false;
|
||||
};
|
||||
|
||||
const onMouseEnter = () => {
|
||||
if (triggerRef.value && hasCursor.value) {
|
||||
if (triggerRef.value && checkHasCursor()) {
|
||||
show(triggerRef.value, props.hotkey, props.text);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user