Results 1 to 6 of 6

Thread: Value not selectable in display and text fields under 6.2.0

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-22710 in 6.2.1.
  1. #1
    Ext JS Premium Member
    Join Date
    Aug 2010
    Posts
    66

    Default Value not selectable in display and text fields under 6.2.0

    Hi all,

    Given the following simple example:

    Code:
    Ext.create("Ext.window.Window", {
      width : 500, height : 300,
      items : [
        { xtype : "displayfield",  fieldLabel : "Field label 1", value : "Field value 1" },
        { xtype : "textfield",  fieldLabel : "Field label 2", value : "Field value 2", readOnly : true },
      ]
    }).show();
    Under the latest version of both Chrome and Firefox, under ExtJS 6.0.2, the user is able to select the values of both fields.

    However, under 6.2.0, the user cannot select the value of the displayfield. While there might be some new option I'm unaware of that allows this (and I'm happy to be told so!) I consider this a regression and therefore a bug since our existing code doesn't work as expected after the upgrade (and we have a part of our app built with displayfields where we need to allow the user to select the values sometimes, so it's a bit of an issue for us).

    Could someone confirm this is a bug, or direct me to how to correct the issue if not?

    Thanks!
    Frank

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report. This issue is being tracked as EXTJS-22710. It has been fixed for 6.2.1.

  3. #3
    Ext JS Premium Member
    Join Date
    Aug 2010
    Posts
    66

    Default

    Thanks Gary, that was quick!

  4. #4
    Sencha Premium Member MichaelOstrovsky's Avatar
    Join Date
    May 2008
    Location
    Tel Aviv, Israel
    Posts
    144

    Default

    Fix for ExtJS 6.2.0.981 (put in overrides dir)

    Code:
    Ext.define('DisplayFieldSelectionFix', {
        override: 'Ext.form.field.Display',
        fieldSubTpl: [
            '<div id="{id}" data-ref="inputEl" role="textbox" aria-readonly="true"',
            ' aria-labelledby="{cmpId}-labelEl" {inputAttrTpl}',
            ' tabindex="<tpl if="tabIdx != null">{tabIdx}<tpl else>-1</tpl>"',
            '<tpl if="fieldStyle"> style="{fieldStyle}"</tpl>',
            ' class="{fieldCls} {fieldCls}-{ui} x-selectable">{value}</div>',
            {
                compiled: true,
                disableFormats: true
            }
        ]
    });

  5. #5

    Default

    Quote Originally Posted by MichaelOstrovsky View Post
    Fix for ExtJS 6.2.0.981 (put in overrides dir)

    Code:
    Ext.define('DisplayFieldSelectionFix', {
        override: 'Ext.form.field.Display',
        fieldSubTpl: [
            '<div id="{id}" data-ref="inputEl" role="textbox" aria-readonly="true"',
            ' aria-labelledby="{cmpId}-labelEl" {inputAttrTpl}',
            ' tabindex="<tpl if="tabIdx != null">{tabIdx}<tpl else>-1</tpl>"',
            '<tpl if="fieldStyle"> style="{fieldStyle}"</tpl>',
            ' class="{fieldCls} {fieldCls}-{ui} x-selectable">{value}</div>',
            {
                compiled: true,
                disableFormats: true
            }
        ]
    });
    This did not work for selecting text in the windows.

  6. #6

    Default

    Code:
    Ext.define('OverrideWindow', {
        override: 'Ext.window.Window',
        onShow: function() {
            var me = this;
            me.callParent(arguments);
            if(me.expandOnShow) {
                me.expand(false);
            }
            me.syncMonitorWindowResize();
            if(me.rendered && me.tabGuard) {
                 me.initTabGuards();
            }
            //remove the class each time
            me.removeCls('x-unselectable');
        }
    });
    Try this instead.

Similar Threads

  1. Display Three text fields in a Row
    By evs.saad in forum Ext: Q&A
    Replies: 1
    Last Post: 10 Dec 2012, 2:16 PM
  2. How can I get selectable text in an expander row
    By bclinton in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 19 Oct 2010, 11:18 AM
  3. Display text between input fields?
    By Dumas in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 22 Mar 2009, 3:45 PM
  4. Replies: 0
    Last Post: 5 Dec 2007, 11:20 AM
  5. Need to display a popup with text fields etc..
    By varun.narang in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 15 May 2007, 7:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •