From 3e23037dc9540a62fc8db1e450b43fca495f99ce Mon Sep 17 00:00:00 2001 From: Cherag Verma Date: Wed, 16 Nov 2016 15:51:54 +0530 Subject: [PATCH] Empty text input will not be added in the list --- index.ios.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.ios.js b/index.ios.js index 80945b8..472d0e7 100644 --- a/index.ios.js +++ b/index.ios.js @@ -97,7 +97,8 @@ class FirebaseReactNativeSample extends Component { { text: 'Add', onPress: (text) => { - this.itemsRef.push({ title: text }) + if (text) { this.itemsRef.push({ title: text }) } /** Will push only if text is not empty */ + else { console.log("Text Input empty") } } }, ], @@ -109,7 +110,7 @@ class FirebaseReactNativeSample extends Component { const onPress = () => { AlertIOS.alert( - 'Complete', + 'Completed ' + item.title + ' ?' , /** Just a small edit to confirm the item name */ null, [ {text: 'Complete', onPress: (text) => this.itemsRef.child(item._key).remove()},