TokenField 7.0.1 is not clearing filter select after new item is added

Hi,

I’m using the new version of TokenField for Vaadin 7.

When I select one item from the list, the item is added to the token list and the filter field is cleared immediately. However, when I type a new item, it’s added to the token list but the filter field is not cleared. So it looks weird because you must delete the previously typed text to enter a new item.

This is a sample code:


    TokenField f = new TokenField(new HorizontalLayout());
    f.setWidth("100%"); // width...
    f.setInputWidth("100%"); // and input width separately

    List<String> list = Arrays.asList("Aaa", "Bbb", "Ccc", "Ddd");
    f.setContainerDataSource(new BeanItemContainer<String>(String.class, list));

    f.setFilteringMode(FilteringMode.CONTAINS); // suggest
    f.setTokenCaptionMode(ItemCaptionMode.ID);

    f.setInputPrompt("Enter text.");
    f.setRememberNewTokens(false); // we can opt to do this ourselves

I’m using Vaadin 7.1.0 (with push options) and TokenField 7.0.1.


Workarround: I used an ExtensionConnector to clear the VFilterSelect widget when ENTER is pressed. I used a timer to avoid interfering with default behaviour. I applied the extension to the “cb” field of TokenField before attach() is called.

Regards,