fix: various fixes on text selector in TTS mode and normal image height (#1390)

This commit is contained in:
Huang Xin
2025-06-13 23:28:21 +08:00
committed by GitHub
parent 20955ec294
commit 467e80cd4b
8 changed files with 228 additions and 50 deletions
@@ -14,7 +14,7 @@ export const useTextSelector = (
) => {
const { appService } = useEnv();
const { getBookData } = useBookDataStore();
const { getView, getViewSettings } = useReaderStore();
const { getView, getViewState, getViewSettings } = useReaderStore();
const view = getView(bookKey);
const bookData = getBookData(bookKey)!;
const primaryLang = bookData.book?.primaryLanguage || 'en';
@@ -94,6 +94,9 @@ export const useTextSelector = (
const handlePointerup = (doc: Document, index: number) => {
// Available on iOS and Desktop, fired at touchend or mouseup
// Note that on Android, pointerup event is fired after an additional touch event
const viewState = getViewState(bookKey);
if (viewState?.ttsEnabled) return;
const sel = doc.getSelection() as Selection;
if (isValidSelection(sel)) {
if (osPlatform === 'ios') {