[FIXED] [#1349] [4.1.0] Date Field editor of label fails in IE

  1. #1

    [FIXED] [#1349] [4.1.0] Date Field editor of label fails in IE

    Hello everyone,

    I ran into following issue:
    If you have a label
    and you are using a date field as an editor of this field
    and this field is located near the right border of the browser window
    then the editing will be forcibly finished by internet explorer when the "calendar" appears.
    This issue is IE specific (The version of IE is 11). In all other browsers all works OK.

    The issue can be easily reproduced using following code:
    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Globalization" %>
    
    <script runat="server" language="c#">
    
        protected void Page_Load(object sender, EventArgs e)
        {
            OrderDateLabel.Text = DateTime.Today.ToString("d", CultureInfo.CurrentCulture);
            OrderTimelabel.Text = DateTime.Now.ToString("T", CultureInfo.CurrentCulture);
        }
    
        [DirectMethod]
        public static void UpdateDate(DateTime date)
        {
            //do something with the date
        }
    
    </script>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>IE issue</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server" DirectMethodNamespace="IS" />
            <ext:Viewport runat="server" Layout="fit" >
                <Items>
                    <ext:Container runat="server" Layout="hbox">
                        <Items>
                            <ext:ToolbarFill runat="server"/>
                            <ext:Label ID="OrderDateLabel" runat="server" StyleSpec="margin-right:5px;">
                                <Editor>
                                    <ext:Editor ID="OrderDateEditor" runat="server" Shadow="false">
                                        <Field>
                                            <ext:DateField ID="OrderDateDateField" runat="server" Cls="x-form-field-editor" Width="120" RemoveClearTrigger="True" />
                                        </Field>
                                        <Listeners>
                                            <StartEdit Handler="this.field.setValue(Ext.Date.parse(App.OrderDateLabel.getText(), App.OrderDateLabel.editor.field.format));"></StartEdit>
                                            <Complete Handler="IS.UpdateDate(this.field.value); 
                                                                App.OrderDateLabel.setText(Ext.util.Format.date(this.field.value, App.OrderDateLabel.editor.field.format));
                                                                App.OrderTimelabel.setText('00:00:00');
                                                                console.log('editing completed because of layout issue');">
                                            </Complete>
    
                                        </Listeners>
                                    </ext:Editor>
                                </Editor>
                            </ext:Label>
                            <ext:Label runat="server" ID="OrderTimelabel" StyleSpec="margin-right:5px;"></ext:Label>
                        </Items>
                    </ext:Container>
                </Items>
            </ext:Viewport>
    
        </form>
    </body>
    </html>
    Here is the video:
    http://screencast.com/t/JZ6wo53YT

    It looks like because of the calendar control doesn't fit into a browser window it forces some layout renew that forcibly finishes editing. This is a guess, I haven't tracked the events and stack trace.

    I've tried to replace the toolbar fill to something else, change the layout to another, tune the position using CSS, the issue appears every time when the control is near the right border of the browser window and no matter how it got there.
    Last edited by fabricio.murta; Jan 05, 2017 at 11:21 PM.
  2. #2
    Hello @suhuy! Thanks for the simple example. I believe you could also remove the listeners to the editor and also the custom stylespecs to avoid confusion, but in the end I could get it and reproduced the ill behavior with IE11.

    We've just logged it as issue #1349 but couldn't find a definitive answer in a first look. Seems there's no related issue reported in Sencha as well -- anyway, they don't have the 'label' component at all, so possibly not reproducible in pure ExtJS.

    As for a work around, in your example if you keep the field 35 pixels away from the right corner of the screen, it works. 30 or less already reproduces the problem.

    I believe that might be an acceptable workaround for the time being. Just change your line 30 to:

    <ext:Container runat="server" Layout="hbox" MarginSpec="0 35 0 0">
    And your editable date label should be good to go! If I just add a DateField to the right of the screen, the problem is not reproducible, so it seems this is related to dynamically creating the editor component on the label.
    Fabrício Murta
    Developer & Support Expert
  3. #3

    Please close this thread

    Thank you for your reply, please close this thread.
  4. #4
    Hello! Actually we logged an issue to track this problem (& hopefully fix it soon!), but I didn't move it to the bugs form.

    So if you don't mind, we'd like to keep this open among with the bug in the tracker so we can fix or remember this was reported when we see the fix coming in a future ExtJS release. :)
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hello!

    Good news! We couldn't reproduce this issue once we merged ExtJS 6.2.1 to Ext.NET! This fix will come live in upcoming Ext.NET 4.2.0 release!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 5
    Last Post: Apr 15, 2016, 1:12 AM
  2. Replies: 8
    Last Post: May 20, 2013, 4:01 AM
  3. Replies: 3
    Last Post: Jul 24, 2012, 8:40 PM
  4. [CLOSED] Label editor with a composite field
    By stratadev in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 24, 2012, 4:04 PM
  5. [CLOSED] Label Editor ComboBox Jumps to left when Editor activated
    By IanPearce in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 19, 2011, 1:31 PM

Tags for this Thread

Posting Permissions