Skip to content

Commit

Permalink
fix(input): Remove past functionality
Browse files Browse the repository at this point in the history
IOS webview doesn't support pressout event; the custom copy past make autocompletable fields
unstable.

Reopen #97
  • Loading branch information
MathieuNls committed Mar 18, 2017
1 parent deccdcc commit d121fb4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 37 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="Toolwatch.Toolwatch" version="1.3.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="Toolwatch.Toolwatch" version="1.3.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Toolwatch - Watch accuracy app</name>
<description>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!</description>
<author email="[email protected]" href="https://toolwatch.io/">Mathieu Nayrolles</author>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 0 additions & 4 deletions src/components/mobile-input/mobile-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
(blur) = "toggleFocus()"
(focus) = "toggleFocus()"
(keyup) = "emitChange($event)"
(press) = "onPress()"
(pressup) = "onPressUp()"
>
</ion-input>

Expand All @@ -34,8 +32,6 @@
[formControl] = "control"
[(ngModel)] = "value"
(ngModelChange) = "valueChange.emit($event)"
(press) = "onPress()"
(pressup) = "onPressUp()"
>
</ion-input>

Expand Down
31 changes: 0 additions & 31 deletions src/components/mobile-input/mobile-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -47,8 +46,6 @@ export class MobileInput {
valueChange = new EventEmitter();

isFocused = false;
pressedOn = 0;
pastTimeOut;


constructor() {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d121fb4

Please sign in to comment.