mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 16:33:16 +00:00
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:
@@ -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"] {
|
||||
|
||||
Reference in New Issue
Block a user