From d121fb43c75e8e96a2163419b8006157b623f6b5 Mon Sep 17 00:00:00 2001 From: Mathieu Nayrolles Date: Sat, 18 Mar 2017 11:35:46 -0400 Subject: [PATCH] fix(input): Remove past functionality IOS webview doesn't support pressout event; the custom copy past make autocompletable fields unstable. Reopen #97 --- config.xml | 2 +- package.json | 2 +- src/components/mobile-input/mobile-input.html | 4 --- src/components/mobile-input/mobile-input.ts | 31 ------------------- 4 files changed, 2 insertions(+), 37 deletions(-) diff --git a/config.xml b/config.xml index 3601f4a..b12bd52 100755 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + Toolwatch - Watch accuracy app Measure and track the accuracy of your mechanical watches. Toolwatch is a free watch accuracy app trusted by the watchmaking industry's leaders and 15 000+ monthly users. Is your watch accurate? Should it be serviced? How does it compare versus other watches? Find out now by measuring the accuracy of your watch! Mathieu Nayrolles diff --git a/package.json b/package.json index 2687fe9..ee31ec7 100755 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "toolwatch-mobile", "author": "Mathieu Nayrolles", "homepage": "https://toolwatch.io/", - "version": "1.3.2", + "version": "1.3.3", "private": true, "scripts": { "ionic:build": "npm run assets && ionic-app-scripts build", diff --git a/src/components/mobile-input/mobile-input.html b/src/components/mobile-input/mobile-input.html index 13354ed..b54e35e 100755 --- a/src/components/mobile-input/mobile-input.html +++ b/src/components/mobile-input/mobile-input.html @@ -16,8 +16,6 @@ (blur) = "toggleFocus()" (focus) = "toggleFocus()" (keyup) = "emitChange($event)" - (press) = "onPress()" - (pressup) = "onPressUp()" > @@ -34,8 +32,6 @@ [formControl] = "control" [(ngModel)] = "value" (ngModelChange) = "valueChange.emit($event)" - (press) = "onPress()" - (pressup) = "onPressUp()" > diff --git a/src/components/mobile-input/mobile-input.ts b/src/components/mobile-input/mobile-input.ts index ef64500..3109ba2 100755 --- a/src/components/mobile-input/mobile-input.ts +++ b/src/components/mobile-input/mobile-input.ts @@ -2,7 +2,6 @@ import { Component, Input, EventEmitter, Output } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { Clipboard } from 'ionic-native'; /* Generates a mobile form input @@ -47,8 +46,6 @@ export class MobileInput { valueChange = new EventEmitter(); isFocused = false; - pressedOn = 0; - pastTimeOut; constructor() { @@ -79,34 +76,6 @@ export class MobileInput { } } - onPressUp(){ - if(Date.now() - this.pressedOn < 1000){ - clearTimeout(this.pastTimeOut); - } - this.pressedOn = 0; - } - - onPress(){ - - this.pressedOn = Date.now(); - this.pastTimeOut = setTimeout(()=>{ - this.paste(); - }, 1000); - - } - - paste(){ - Clipboard.paste().then( - (resolve: string) => { - this.value = resolve; - this.valueChange.emit(this.value); - }, - (reject: string) => { - console.error("Unsucessful pasting") - } - ); - } - toggleFocus():void{ this.isFocused = !this.isFocused; }