fix(native): a long press in the app selects no text and opens no callout

In the iOS and Android app a long press on a label, card or image started a text
selection, the magnifier or a "save image" menu, the clearest sign of a web page
in a frame. startNativeApp marks <html> with data-native-app, and index.css then
turns selection and the callout off for the UI. Inputs, textareas, selects and
editors stay selectable so typing, pasting and the caret work; text worth copying
opts in with .trek-selectable. A browser keeps its default.
This commit is contained in:
Maurice
2026-11-09 08:32:24 +01:00
parent fede671f3b
commit d9baaa8957
3 changed files with 31 additions and 0 deletions
+20
View File
@@ -391,6 +391,26 @@ html, body {
-webkit-tap-highlight-color: transparent;
}
/* Inside the iOS and Android app (native/nativeApp.ts sets the attribute): a long
press on a label, card or image does nothing, as in a native app, instead of
starting a text selection, a magnifier or a "save image" callout. What the user
types into stays selectable, or editing, pasting and moving the caret would break;
text worth copying opts in with .trek-selectable. A browser keeps its default. */
html[data-native-app] body {
-webkit-user-select: none;
user-select: none;
-webkit-touch-callout: none;
}
html[data-native-app] :is(input, textarea, select, [contenteditable]:not([contenteditable='false']), .trek-selectable),
html[data-native-app] :is([contenteditable]:not([contenteditable='false']), .trek-selectable) * {
-webkit-user-select: text;
user-select: text;
-webkit-touch-callout: default;
}
html[data-native-app] img {
-webkit-user-drag: none;
}
/* Tabular-nums global für Time/Date/Currency/Counter */
time, .tabular-nums, [data-tabular],
input[type="number"], input[type="time"], input[type="date"], input[type="datetime-local"] {