Skip to content

Commit

Permalink
Fixed a bug with focus (Keyboard staying up)
Browse files Browse the repository at this point in the history
  • Loading branch information
zenled committed Dec 17, 2016
1 parent 98eabb3 commit 098dca9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/views/get-effect/get-effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import frameModule = require("ui/frame");
var topmost = frameModule.topmost();
let timer = require("timer");
var imageSource = require("image-source");
import tabViewModule = require("ui/tab-view");

import * as Toast from 'nativescript-toast';

Expand All @@ -20,6 +21,7 @@ let displayForMinutes_field: textFieldModule.TextField;
let displayForSeconds_field: textFieldModule.TextField;
let effectGet_image: ImageModule.Image;
let start_button: buttonModule.Button;
let tabView: tabViewModule.TabView;

// data
enum McColloughImage{
Expand Down Expand Up @@ -64,8 +66,15 @@ exports.onLoaded = function(args: observable.EventData){
displayForSeconds_field = <textFieldModule.TextField> page.getViewById("displayForSeconds_field");
effectGet_image = <ImageModule.Image> page.getViewById("effectGet_image");
start_button = <buttonModule.Button> page.getViewById("start_button")
tabView = <tabViewModule.TabView> page.getViewById("tabViewContainer")

tabView.on(tabViewModule.TabView.selectedIndexChangedEvent, (args: tabViewModule.SelectedIndexChangedEventData) => {
clearFocus()
});

timerStop();

clearFocus()
}

// ****************************************** Inputs *****************************
Expand Down Expand Up @@ -109,6 +118,18 @@ exports.onNavBtnTapBack = function(){
topmost.navigate("views/main-view/main-view")
}





function clearFocus(){
if (page.android){
imageDuration_field.android.clearFocus();
displayForMinutes_field.android.clearFocus();
displayForSeconds_field.android.clearFocus();
}
}

// ******************************************** Data *************************************
/**
* @returns True if input is valid
Expand Down

0 comments on commit 098dca9

Please sign in to comment.