mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
chore(input): do not force blur on .input-cover tap
This commit is contained in:
@ -40,11 +40,11 @@ export class NativeInput {
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self.focusChange.emit(true);
|
self.focusChange.emit(true);
|
||||||
|
|
||||||
function docTouchEnd(ev) {
|
function docTouchEnd(ev) {
|
||||||
var tappedElement: any = ev.target;
|
var tapped: HTMLElement = ev.target;
|
||||||
if (tappedElement && self.element()) {
|
if (tapped && self.element()) {
|
||||||
if (tappedElement.tagName !== "INPUT" && tappedElement.tagName !== "TEXTAREA") {
|
if (tapped.tagName !== "INPUT" && tapped.tagName !== "TEXTAREA" && !tapped.classList.contains('input-cover')) {
|
||||||
self.element().blur();
|
self.element().blur();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ export class NativeInput {
|
|||||||
// 1) this input has focus
|
// 1) this input has focus
|
||||||
// 2) the newly tapped document element is not an input
|
// 2) the newly tapped document element is not an input
|
||||||
console.debug('input blurring enabled');
|
console.debug('input blurring enabled');
|
||||||
|
|
||||||
document.addEventListener('touchend', docTouchEnd, true);
|
document.addEventListener('touchend', docTouchEnd, true);
|
||||||
self._unrefBlur = function() {
|
self._unrefBlur = function() {
|
||||||
console.debug('input blurring disabled');
|
console.debug('input blurring disabled');
|
||||||
|
Reference in New Issue
Block a user