FlowingCode / ChipFieldAddon

Vaadin Flow integration of https://github.com/ThomasCybulski/paper-chip
Apache License 2.0
7 stars 5 forks source link

ValueChangeListener not working on deleting chips #32

Closed ngonzalezpazFC closed 3 years ago

ngonzalezpazFC commented 3 years ago

As far as I tested, the problem occurs only while deleting elements. The valueChangeListener does not catch the event in these cases, neither having a DataProvider nor using setAvailableItems method:

javier-godoy commented 3 years ago

@ngonzalezpazFC Can you test again with the latest changes in master?

ngonzalezpazFC commented 3 years ago

The lastest changes solved this issue.

javier-godoy commented 3 years ago

Note: this was fixed by #35 and/or #36

ngonzalezpazFC commented 3 years ago

Manually deleting an item added with setValue(), as the following code shows, was not detected before by the value change event, but now it does:

chipfield.addValueChangeListener(e -> {
        Notification n = new Notification("Value changed");
        n.open();
    });
chipfield.setValue(Arrays.asList(new Planet("Test")));

Also, deleting a a chip added manually (chip not provided by the DataProvider assigned to the chipfield), is now triggering the value change event.