Results 1 to 4 of 4

Thread: Typeahead feature in TagField does not work if emptyText is configured

    You found a bug! We've classified it as EXTJS-19841 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Jan 2016
    Posts
    2

    Default Typeahead feature in TagField does not work if emptyText is configured

    Typeahead is not working in TagFields if I am setting emptyText.

    Please see example code below:

    Code:
    Ext.create('Ext.form.Panel', {
        title: 'Tag Field Example',
        width: 1000,
        bodyPadding: 10,
    
    
    
    
        items: [{
            xtype: 'fieldcontainer',
            labelWidth: 100,
            layout: 'vbox',
            items: [{
                xtype: 'tagfield',
                fieldLabel: 'Tag Field :(    ',
                store: ['Hello', '21', 'Adele'],
                queryMode: 'local',
                filterPickList: true,
                emptyText: 'Type ahead does not work with empty text.',
                forceSelection: false,
                createNewOnBlur: true,
                createNewOnEnter: true,
                typeAhead: true,
                autocomplete: 'off'
            }, {
                xtype: 'tagfield',
                fieldLabel: 'Tag Field :)     ',
                store: ['Hello', '21', 'Adele'],
                queryMode: 'local',
                filterPickList: true,
                forceSelection: false,
                createNewOnBlur: true,
                createNewOnEnter: true,
                typeAhead: true,
                autocomplete: 'off'
            }]
        }],
        renderTo: Ext.getBody()
    });
    Fiddle Example: https://fiddle.sencha.com/#fiddle/13t3

    Also noticed the TagField's drop-down list does not close if I click outside the field when I am setting emptyText.

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579

    Default

    Thanks for the example. We have a bug report of this currently under EXTJS-19841.
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  3. #3

    Default

    Add listeners to solve issue:

    Code:
    listeners: {
                                            afterrender: function (ctl, e, eOpts) {
                                                  var values = ctl.getValueRecords();
                                                  ctl.inputEl.set( { 'placeholder': values.length ? '' :'Your text'});
                                            },
                                            change:function(ctl){
                                                var values = ctl.getValueRecords();
                                                ctl.inputEl.set( { 'placeholder': values.length ? '' :'Your text'});
                                            }
    }

  4. #4
    Sencha Premium Member richardvd's Avatar
    Join Date
    Jun 2011
    Location
    NL
    Posts
    255

    Default

    This bug has been fixed since Ext JS 6.2.0.

Similar Threads

  1. [DUP] Glitch in tagfield when using emptyText config
    By brocktopia in forum Ext 5: Bugs
    Replies: 5
    Last Post: 19 May 2016, 1:31 PM
  2. [FIXED] emptyText causes problem with initial display in Tagfield
    By ngd in forum Ext 5: Bugs
    Replies: 4
    Last Post: 16 Dec 2015, 3:07 PM
  3. Replies: 3
    Last Post: 8 Sep 2015, 8:27 AM
  4. Replies: 3
    Last Post: 26 Mar 2015, 1:42 AM
  5. [OPEN] Style emptyText of TagField is bad
    By ray_qwer in forum Ext 5: Bugs
    Replies: 1
    Last Post: 26 Aug 2014, 12:28 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
  •