vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
618 stars 167 forks source link

Blurring an empty TextField (without doing anything in the field) causes a server visit #17429

Closed mstahv closed 11 months ago

mstahv commented 1 year ago

Description of the bug

Blurring an empty TextField (without doing anything in the field) causes a server visit

Expected behavior

There should be no obsolete server visits.

Minimal reproducible example

Use this UI, click text field and document body repeatedly, watch the show in web inspectors network tab.

@Route
public class MainView extends VerticalLayout {

    public MainView() {
        TextField textField = new TextField();
        add(textField);
    }
}

Versions

Vaadin: 24.1.4 Flow: 24.1.5 Java: Eclipse Adoptium 17.0.2 OS: aarch64 Mac OS X 13.5 Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Live reload: Java active (Spring Boot Devtools): Front end active

knoobie commented 1 year ago

Doesn't the dirty flag already fixes this? Or does this still happen with the new flag? https://github.com/vaadin/web-components/pull/6160

Edit: more information about the flag here: https://github.com/vaadin/flow-components/issues/5712 which describes exactly your problem that leaving the field causes a server rountrip with no change

TatuLund commented 1 year ago

Related to https://github.com/vaadin/flow-components/issues/4986

caalador commented 1 year ago

As the event is a validated event let's see what happens after the components validation logic update.

vursen commented 1 year ago

The issue will be resolved as part of https://github.com/vaadin/flow-components/issues/5537.

yuriy-fix commented 11 months ago

The issue is resolved as a part of #5537. Fix is available in 24.3.0-beta1. DateTimePicker behaviour will be tackled separately.