Skip to content

Commit 78c093d

Browse files
committed
stop closing keyboard when touch grid lines
1 parent bafd431 commit 78c093d

File tree

7 files changed

+26
-11
lines changed

7 files changed

+26
-11
lines changed

dist/numeric_keyboard.angular.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ var Mixins = exports.Mixins = {
16391639
},
16401640
onTouchend: function onTouchend(key, event) {
16411641
key.deactive(event.target);
1642-
event.stopPropagation();
1642+
//event.stopPropagation()
16431643
this.dispatch('press', key.code);
16441644
}
16451645
};
@@ -2170,10 +2170,13 @@ var KeyboardCenter = function () {
21702170
activeInput = input;
21712171
document.addEventListener('touchend', this.unregister, false);
21722172
},
2173-
unregister: function unregister() {
2173+
unregister: function unregister(e) {
21742174
if (!activeInput) {
21752175
return;
21762176
}
2177+
if (e && activeInput.ks.keyboardElement.contains(e.target)) {
2178+
return;
2179+
}
21772180
activeInput.closeKeyboard();
21782181
activeInput = null;
21792182
document.removeEventListener('touchend', this.unregister, false);

dist/numeric_keyboard.react.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ var Mixins = exports.Mixins = {
16391639
},
16401640
onTouchend: function onTouchend(key, event) {
16411641
key.deactive(event.target);
1642-
event.stopPropagation();
1642+
//event.stopPropagation()
16431643
this.dispatch('press', key.code);
16441644
}
16451645
};
@@ -2170,10 +2170,13 @@ var KeyboardCenter = function () {
21702170
activeInput = input;
21712171
document.addEventListener('touchend', this.unregister, false);
21722172
},
2173-
unregister: function unregister() {
2173+
unregister: function unregister(e) {
21742174
if (!activeInput) {
21752175
return;
21762176
}
2177+
if (e && activeInput.ks.keyboardElement.contains(e.target)) {
2178+
return;
2179+
}
21772180
activeInput.closeKeyboard();
21782181
activeInput = null;
21792182
document.removeEventListener('touchend', this.unregister, false);

dist/numeric_keyboard.vanilla.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ var Mixins = exports.Mixins = {
16391639
},
16401640
onTouchend: function onTouchend(key, event) {
16411641
key.deactive(event.target);
1642-
event.stopPropagation();
1642+
//event.stopPropagation()
16431643
this.dispatch('press', key.code);
16441644
}
16451645
};
@@ -2170,10 +2170,13 @@ var KeyboardCenter = function () {
21702170
activeInput = input;
21712171
document.addEventListener('touchend', this.unregister, false);
21722172
},
2173-
unregister: function unregister() {
2173+
unregister: function unregister(e) {
21742174
if (!activeInput) {
21752175
return;
21762176
}
2177+
if (e && activeInput.ks.keyboardElement.contains(e.target)) {
2178+
return;
2179+
}
21772180
activeInput.closeKeyboard();
21782181
activeInput = null;
21792182
document.removeEventListener('touchend', this.unregister, false);

dist/numeric_keyboard.vue.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ var Mixins = exports.Mixins = {
16391639
},
16401640
onTouchend: function onTouchend(key, event) {
16411641
key.deactive(event.target);
1642-
event.stopPropagation();
1642+
//event.stopPropagation()
16431643
this.dispatch('press', key.code);
16441644
}
16451645
};
@@ -2170,10 +2170,13 @@ var KeyboardCenter = function () {
21702170
activeInput = input;
21712171
document.addEventListener('touchend', this.unregister, false);
21722172
},
2173-
unregister: function unregister() {
2173+
unregister: function unregister(e) {
21742174
if (!activeInput) {
21752175
return;
21762176
}
2177+
if (e && activeInput.ks.keyboardElement.contains(e.target)) {
2178+
return;
2179+
}
21772180
activeInput.closeKeyboard();
21782181
activeInput = null;
21792182
document.removeEventListener('touchend', this.unregister, false);

lib/input.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ const KeyboardCenter = (function () {
2828
activeInput = input
2929
document.addEventListener('touchend', this.unregister, false)
3030
},
31-
unregister() {
31+
unregister(e) {
3232
if (!activeInput) {
3333
return
3434
}
35+
if (e && activeInput.ks.keyboardElement.contains(e.target)) {
36+
return
37+
}
3538
activeInput.closeKeyboard()
3639
activeInput = null
3740
document.removeEventListener('touchend', this.unregister, false)

lib/keyboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const Mixins = {
125125

126126
onTouchend(key, event) {
127127
key.deactive(event.target)
128-
event.stopPropagation()
128+
//event.stopPropagation()
129129
this.dispatch('press', key.code)
130130
}
131131

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "numeric-keyboard",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Numeric keyboard for mobile browsers",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)