From 8a1ad1da2c2d62ea397bb847f9dff0502148ffb3 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Sun, 29 Jul 2018 14:48:05 +0200 Subject: [PATCH] fix(app): user-select on desktop --- core/src/components/app/app.scss | 4 ++++ core/src/components/app/app.tsx | 3 +++ core/src/components/button/button.scss | 1 - core/src/components/checkbox/checkbox.scss | 2 ++ core/src/components/fab-button/fab-button.scss | 1 - .../infinite-scroll-content/infinite-scroll-content.scss | 2 ++ core/src/components/radio/radio.scss | 2 ++ core/src/components/segment-button/segment-button.scss | 1 - core/src/components/spinner/spinner.scss | 2 ++ core/src/css/structure.scss | 1 - 10 files changed, 15 insertions(+), 4 deletions(-) diff --git a/core/src/components/app/app.scss b/core/src/components/app/app.scss index 91066cf17f..49d0cb3358 100644 --- a/core/src/components/app/app.scss +++ b/core/src/components/app/app.scss @@ -35,6 +35,10 @@ ion-app, display: none !important; } +ion-app.is-device { + user-select: none; +} + // Misc // -------------------------------------------------- diff --git a/core/src/components/app/app.tsx b/core/src/components/app/app.tsx index 0edc00713b..5ac1b5e738 100644 --- a/core/src/components/app/app.tsx +++ b/core/src/components/app/app.tsx @@ -20,11 +20,14 @@ export class App { } hostData() { + const device = this.config.getBoolean('isDevice', isDevice(this.win)); const hybrid = isHybrid(this.win); const statusBar = this.config.getBoolean('statusbarPadding', hybrid); return { class: { + 'is-device': device, + 'is-hydrid': hybrid, 'statusbar-padding': statusBar } }; diff --git a/core/src/components/button/button.scss b/core/src/components/button/button.scss index 4db7533466..ece4501b85 100644 --- a/core/src/components/button/button.scss +++ b/core/src/components/button/button.scss @@ -135,7 +135,6 @@ cursor: pointer; opacity: var(--opacity); overflow: var(--overflow); - user-select: none; vertical-align: top; // the better option for most scenarios vertical-align: -webkit-baseline-middle; // the best for those that support it z-index: 0; diff --git a/core/src/components/checkbox/checkbox.scss b/core/src/components/checkbox/checkbox.scss index b937054900..7b77e7ae83 100644 --- a/core/src/components/checkbox/checkbox.scss +++ b/core/src/components/checkbox/checkbox.scss @@ -14,6 +14,8 @@ display: inline-block; position: relative; + + user-select: none; } :host(.checkbox-checked) .checkbox-icon { diff --git a/core/src/components/fab-button/fab-button.scss b/core/src/components/fab-button/fab-button.scss index a88d61d4c1..9b2adb8eac 100755 --- a/core/src/components/fab-button/fab-button.scss +++ b/core/src/components/fab-button/fab-button.scss @@ -62,7 +62,6 @@ contain: strict; cursor: pointer; overflow: hidden; - user-select: none; z-index: 0; font-kerning: none; appearance: none; diff --git a/core/src/components/infinite-scroll-content/infinite-scroll-content.scss b/core/src/components/infinite-scroll-content/infinite-scroll-content.scss index dccc101fc6..273eace261 100644 --- a/core/src/components/infinite-scroll-content/infinite-scroll-content.scss +++ b/core/src/components/infinite-scroll-content/infinite-scroll-content.scss @@ -12,6 +12,8 @@ ion-infinite-scroll-content { min-height: $infinite-scroll-content-min-height; text-align: center; + + user-select: none; } .infinite-loading { diff --git a/core/src/components/radio/radio.scss b/core/src/components/radio/radio.scss index 511b96f2fe..9c69952412 100644 --- a/core/src/components/radio/radio.scss +++ b/core/src/components/radio/radio.scss @@ -9,6 +9,8 @@ display: inline-block; position: relative; box-sizing: border-box; + + user-select: none; } .radio-icon { diff --git a/core/src/components/segment-button/segment-button.scss b/core/src/components/segment-button/segment-button.scss index 0e42cbfab2..9f8a3f2126 100644 --- a/core/src/components/segment-button/segment-button.scss +++ b/core/src/components/segment-button/segment-button.scss @@ -61,7 +61,6 @@ contain: content; cursor: pointer; overflow: hidden; - user-select: none; font-kerning: none; &:active, diff --git a/core/src/components/spinner/spinner.scss b/core/src/components/spinner/spinner.scss index 7261fa7523..691d718c22 100644 --- a/core/src/components/spinner/spinner.scss +++ b/core/src/components/spinner/spinner.scss @@ -9,6 +9,8 @@ width: 28px; height: 28px; + + user-select: none; } :host(.ion-color) { diff --git a/core/src/css/structure.scss b/core/src/css/structure.scss index b95c229161..81e9d5b293 100644 --- a/core/src/css/structure.scss +++ b/core/src/css/structure.scss @@ -38,7 +38,6 @@ body { overflow: hidden; touch-action: manipulation; - user-select: none; -webkit-user-drag: none;