shaungyuehuoniao / gwt-ext

Automatically exported from code.google.com/p/gwt-ext
0 stars 2 forks source link

Type-ahead enabled combo box modifies user input #324

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a combo with a few options
2. In a browser start typing a value that is not in the list, but with a
similar prefix to one of the options (speed of key presses is important)

What is the expected output? What do you see instead?

When the prefix no longer matches any available options, the text field
should contain the user input in exactly the same case it was entered. 
Sometimes the field will completely swallow key presses, most of the time
it will have changed the case of the user input

What version of the product are you using? On what operating system?

GWT-Ext 2.0.3 on Linux.

Please provide any additional information below.

The following will provide a combo on which this can be observed.  Typing
"frog" at a reasonably slow speed may leave the text field containing the
word "foo" or "foog".  Typing "badger" will generally leave you with "Badger".

public void onModuleLoad() {
    final Object[][] twoDimData = new Object[][] {new Object[] {"foo"}, new
Object[] {"Bar"}};

    final FieldDef[] fields = new FieldDef[]{new StringFieldDef("label")};
    final SimpleStore store = new SimpleStore(-1, fields, twoDimData);
    store.load();
    final ComboBox combo = new
ComboBox(UploadWizardDisplayText.INSTANCE.defaultSelectTaxonomy());
    combo.setDisplayField("label");
    combo.setTypeAhead(true);
    combo.setStore(store);

    final Panel panel = new Panel();
    panel.add(combo);
    new Viewport(panel);
}

Original issue reported on code.google.com by mhutchin...@gmail.com on 29 Apr 2008 at 12:47

GoogleCodeExporter commented 8 years ago
Oops, left some external references in there.  Try the following onModuleLoad 
instead:

public void onModuleLoad() {
    final Object[][] twoDimData = new Object[][] {new Object[] {"foo"}, new
Object[] {"Bar"}};

    final FieldDef[] fields = new FieldDef[]{new StringFieldDef("label")};
    final SimpleStore store = new SimpleStore(-1, fields, twoDimData);
    store.load();
    final ComboBox combo = new ComboBox();
    combo.setDisplayField("label");
    combo.setTypeAhead(true);
    combo.setStore(store);

    final Panel panel = new Panel();
    panel.add(combo);
    new Viewport(panel);
}

Original comment by mhutchin...@gmail.com on 29 Apr 2008 at 12:49