Dec 06, 2016, 3:16 PM
[CLOSED] Erratic field focus when multiple fields have selectOnFocus="true"
Hi,
We're experiencing a strange issue with field focus problems and the SelectOnFocus property.
Using the simple test case below the field context should be auto selected on focus which works the first few times, and then the focus will erratically switch between fields. The easiest way to reproduce the issue:
1. Click into one of the fields
2. Click into a different field
3. Switch focus away from the browser so some other app you have open
4. Switch focus back to the browser by clicking into one of the fields.
The browser will now be switching focus between the fields rather than the expected behaviour of focusing and selecting the text in the field.
Using Chrome Version 54.0.2840.99 m on Windows 10 with latest code from SVN /premium/2 branch.
We're experiencing a strange issue with field focus problems and the SelectOnFocus property.
Using the simple test case below the field context should be auto selected on focus which works the first few times, and then the focus will erratically switch between fields. The easiest way to reproduce the issue:
1. Click into one of the fields
2. Click into a different field
3. Switch focus away from the browser so some other app you have open
4. Switch focus back to the browser by clicking into one of the fields.
The browser will now be switching focus between the fields rather than the expected behaviour of focusing and selecting the text in the field.
Using Chrome Version 54.0.2840.99 m on Windows 10 with latest code from SVN /premium/2 branch.
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>NumberField - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
</head>
<body>
<ext:ResourceManager runat="server" />
<h1>NumberField</h1>
<ext:FormPanel
ID="Panel1"
runat="server"
Title="Simple Form"
Width="210"
Frame="true"
Layout="Form"
BodyPadding="5">
<FieldDefaults SelectOnFocus="True">
</FieldDefaults>
<Items>
<ext:NumberField MinValue="0" AllowDecimals="True" DecimalPrecision="2" runat="server" Text="0"
Flex="1" LabelAlign="Top" FieldCls="opus-field editable centered"
AllowBlank="False" FieldLabel="Setups" LabelSeparator="" />
<ext:NumberField MinValue="0" AllowDecimals="True" DecimalPrecision="2" runat="server" Text="0"
Flex="1" LabelAlign="Top" FieldCls="opus-field editable centered"
AllowBlank="False" FieldLabel="Setups" LabelSeparator="" />
<ext:NumberField MinValue="0" AllowDecimals="True" DecimalPrecision="2" runat="server" Text="0"
Flex="1" LabelAlign="Top" FieldCls="opus-field editable centered"
AllowBlank="False" FieldLabel="Setups" LabelSeparator="" />
<ext:Container runat="server" ColumnWidth="0.1" Layout="Form">
<Items>
<ext:NumberField MinValue="0" AllowDecimals="True" DecimalPrecision="2" runat="server" Text="0"
Flex="1" LabelAlign="Top" FieldCls="opus-field editable centered"
AllowBlank="False" FieldLabel="Setups" LabelSeparator="" />
</Items>
</ext:Container>
<ext:Container runat="server" ColumnWidth="0.1" Layout="Form">
<Items>
<ext:NumberField MinValue="0" AllowDecimals="True" DecimalPrecision="2" runat="server"
Flex="1" Name="CutSides" LabelAlign="Top" FieldCls="opus-field editable centered" Text="0"
AllowBlank="False" FieldLabel="Sides" LabelSeparator="" />
</Items>
</ext:Container>
<ext:Container runat="server" ColumnWidth="0.2" Layout="Form">
<Items>
<ext:SelectBox runat="server" DisplayField="Name" ValueField="Id" Name="CutterId"
ReadOnly="True" ID="SelectCutter" LabelAlign="Top" QueryMode="Local" TriggerAction="All"
AllowBlank="True" FieldLabel="Machine" Flex="1" FieldCls="opus-field autopick">
<Store>
<ext:Store runat="server"
AutoDataBind="true">
<Model>
<ext:Model runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="Id" Type="Int" />
<ext:ModelField Name="Name" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<Triggers>
<ext:FieldTrigger Icon="Clear" Tag="Clear" />
</Triggers>
<Listeners>
<TriggerClick Handler="if (tag == 'Clear') { this.setValue('', true); }" />
</Listeners>
</ext:SelectBox>
</Items>
</ext:Container>
<ext:Container runat="server" ColumnWidth="0.1" Layout="Form">
<Items>
<ext:DisplayField runat="server" Name="CutSetupCost" Note="Per setup" FieldLabel=" "
LabelAlign="Top" LabelSeparator="">
</ext:DisplayField>
</Items>
</ext:Container>
<ext:Container runat="server" ColumnWidth="0.1" Layout="Form">
<Items>
<ext:DisplayField runat="server" Name="CutCostPer1000" Note="Per 1000" FieldLabel=" "
LabelAlign="Top" LabelSeparator="">
</ext:DisplayField>
</Items>
</ext:Container>
<ext:Container runat="server" ColumnWidth="0.1" Layout="Form">
<Items>
<ext:DisplayField runat="server" Text="" />
</Items>
</ext:Container>
<ext:Container runat="server" ColumnWidth="0.1" Layout="Form" Cls="opus-v-divider">
<Items>
<ext:DisplayField runat="server" Flex="1" Name="CutSetupTotalCost" HideLabel="True"
Note="Cost">
</ext:DisplayField>
</Items>
</ext:Container>
</Items>
</ext:FormPanel>
</body>
</html>
Last edited by fabricio.murta; Jan 21, 2017 at 3:13 PM.
Reason: no user feedback for 7+ days