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
+7
View File
@@ -43,6 +43,7 @@ beforeEach(() => {
vi.mocked(isEffectivelyOffline).mockReturnValue(false);
vi.mocked(keepOfflineShellFresh).mockResolvedValue();
document.documentElement.classList.remove('dark');
document.documentElement.removeAttribute('data-native-app');
});
afterEach(() => {
@@ -55,6 +56,12 @@ describe('startNativeApp', () => {
startNativeApp();
expect(App.addListener).not.toHaveBeenCalled();
expect(StatusBar.setStyle).not.toHaveBeenCalled();
expect(document.documentElement.hasAttribute('data-native-app')).toBe(false);
});
it('marks <html> so a long press selects no text in the app', () => {
startNativeApp();
expect(document.documentElement.hasAttribute('data-native-app')).toBe(true);
});
it("Android's back gesture closes an open sheet before it leaves the page", () => {