[PWA] Disable Text Selection and Touch Callouts in a PWA on iOS

Because an installed PWA is really just a web app running in a browser, there are some browser behaviors that we may not want in our app, if we're going for a more "native" feel.

We'll first disable the ability to select text in our app by setting the css user-select options to none.

Then, we'll disable the iOS long-press "callout" menu by setting -webkit-touch-callout to none.

App.css

body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;

  -webkit-touch-callout: none;
}

猜你喜欢

转载自www.cnblogs.com/Answer1215/p/10199591.html
PWA
今日推荐