[CLOSED] Erratic field focus when multiple fields have selectOnFocus="true"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [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.


    <%@ 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="&nbsp;"
                            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="&nbsp;"
                            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>
    Attached Thumbnails Click image for larger version. 

Name:	Focus Issue.jpg 
Views:	60 
Size:	12.4 KB 
ID:	24789  
    Last edited by fabricio.murta; Jan 21, 2017 at 3:13 PM. Reason: no user feedback for 7+ days

Similar Threads

  1. Replies: 1
    Last Post: Aug 21, 2015, 9:51 AM
  2. Replies: 8
    Last Post: Aug 11, 2015, 1:52 PM
  3. Replies: 7
    Last Post: Jan 20, 2015, 6:06 PM
  4. [CLOSED] Hidden="true" behaves as Visible="false"
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: May 28, 2012, 3:17 PM
  5. Replies: 5
    Last Post: May 02, 2012, 5:37 PM

Tags for this Thread

Posting Permissions