Results 1 to 2 of 2

Thread: Modern ComboBox select event on focus leave

  1. #1
    Sencha Premium User
    Join Date
    Sep 2013
    Posts
    6

    Question Modern ComboBox select event on focus leave

    Example: https://fiddle.sencha.com/#view/editor&fiddle/288o
    Use Case: I'm using combobox to search for some data, typing first letters of searched value will open list with possible values. I want to check somewhere in the page or switch to another window and I'm clicking outside of combobox.
    Current behavior: Combobox will lose focus and select event will be fired in case that the user didn't select anything from combobox
    Expected: Combobox will lose focus and list will be closed. Searched value will stay in the input field.

    Can I walk around this behavior somehow? Do you think that this is UX issue?

    I need behavior like google search. Type something in the input -> opens you list with suggestions -> click outside of list and input -> close the list and nothing is selected.

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892
    Answers
    41

    Default

    Implement an assertValueOnBlur config:

    Code:
    Ext.define(null, {
        override: 'Ext.form.field.ConboBox',
    
        // True by default to maintain backwards compatible behaviour
        assertValueOnBlur: true
    
        completeEdit: function(e) {
            var me = this, rT;
    
            this.callParent([e]);
            me.doQueryTask.cancel();
            if (assertValueOnBlur && !rT) {
                me.assertValue();
            }
    
            if (me.queryFilter && me.queryMode === 'local' && me.clearFilterOnBlur) {
                me.clearLocalFilter();
            }
        }
    });
    This option should probably go into the framework. But....

Similar Threads

  1. Replies: 3
    Last Post: 12 Feb 2019, 6:57 AM
  2. Replies: 1
    Last Post: 4 Nov 2015, 1:23 PM
  3. Tap or Focus event for selectfield and using native select
    By roycyang in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 19 Mar 2012, 12:10 PM
  4. Combobox change event does not till focus it loose focus?
    By saadkhan in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 6 Mar 2010, 8:26 AM

Tags for this Thread

Posting Permissions

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