Sep 08, 2017, 6:01 PM
[FIXED] [#1542] [4.5.0] Unable to Focus TextField that has EmptyText using Tablet
Starting with 4.3, I am no longer able to focus inside of a TextField that has EmptyText set using a tablet. I tested the following using the iPad emulator in Chrome F12.
I am using the following code as an override to fix this issue -- but not sure what larger issues this patch could cause:
<%@ Page Language="C#" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Input Mask - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
<style type="text/css">
.x-form-item-body {
height: initial
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Window
ID="Window1"
runat="server"
Width="550"
Title="Input Mask"
Closable="false"
Layout="Form"
BodyPadding="5">
<Defaults>
<ext:Parameter Name="LabelWidth" Value="200" />
</Defaults>
<Items>
<ext:TextField EmptyText="user"></ext:TextField>
<ext:TextField EmptyText="password"></ext:TextField>
</Items>
</ext:Window>
</form>
</body>
</html>
I am using the following code as an override to fix this issue -- but not sure what larger issues this patch could cause:
Ext.define('fixTouchFocus', {
override: 'Ext.form.field.Text',
initEvents: function () {
var me = this, el = me.inputEl;
me.superclass.initEvents();
if (me.selectOnFocus) {
me.mon(el, 'mousedown', me.onMouseDown, me);
}
if (me.maskRe || me.vtype && me.disableKeyFilter !== true && (me.maskRe = Ext.form.field.VTypes[me.vtype + 'Mask'])) {
me.mon(el, 'keypress', me.filterKeys, me);
}
if (me.enableKeyEvents) {
me.mon(el, { scope: me, keyup: me.onKeyUp, keydown: me.onKeyDown, keypress: me.onKeyPress });
}
}
});
Last edited by fabricio.murta; Oct 14, 2017 at 7:08 PM.