CustomField - tracking changes

CustomField constructor looks like this:

    public CustomField(T defaultValue) {
        super(defaultValue);
        this.getElement().addEventListener("change", (e) -> {
            this.updateValue();
        });
    }

    ...
	...
	
	protected void updateValue() {
        this.setModelValue(this.generateModelValue(), false);
    }

This means that any change that occurs at the client side will fire updateValue() but if there is a “Value Change Listener”, the event received by it will NOT show it as coming from the client (see the false value passed to setModelValue. Is this a bug?

I feel that the correct constructor should be:

    public CustomField(T defaultValue) {
        super(defaultValue);
        this.getElement().addEventListener("change", (e) -> {
            this.setModelValue(this.generateModelValue(), true);
        });
    }

Thanks for reporting this. We are taking a look and we will keep you updated through the issue you created in https://github.com/vaadin/vaadin-custom-field-flow/issues/13

Thank you Tulio for the fix. I hope it will be released in 13.0.2.

You’re welcome, Syam. The new version of vaadin-custom-field-flow has been included in the V13 branch of the platform, so it will be in the next release.