Skip to content
Snippets Groups Projects
Commit 698e0d08 authored by syuilo's avatar syuilo
Browse files

fix(client): モバイルでタップしたときにツールチップが表示される問題を修正

parent 8e0108a0
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,16 @@ import { resolve } from '@/router';
import { $i } from '@/account';
import { defaultStore } from '@/store';
export let isScreenTouching = false;
window.addEventListener('touchstart', () => {
isScreenTouching = true;
}, { passive: true });
window.addEventListener('touchend', () => {
isScreenTouching = false;
}, { passive: true });
export const stream = markRaw(new Misskey.Stream(url, $i));
export const pendingApiRequestsCount = ref(0);
......
import { isScreenTouching } from '@/os';
import { Ref, ref } from 'vue';
export function useTooltip(onShow: (showing: Ref<boolean>) => void) {
......@@ -10,6 +11,10 @@ export function useTooltip(onShow: (showing: Ref<boolean>) => void) {
close();
if (!isHovering) return;
// iOS(Androidも?)では、要素をタップした直後に(おせっかいで)mouseoverイベントを発火させたりするため、その対策
// これが無いと、画面に触れてないのにツールチップが出たりしてしまう
if (!isScreenTouching) return;
const showing = ref(true);
onShow(showing);
changeShowingState = () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment