Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Putting TextField to LAZY value change mode causes and obsolete server round-trip, even if the textfield is not used #17430

Open
mstahv opened this issue Aug 11, 2023 · 4 comments

Comments

@mstahv
Copy link
Member

mstahv commented Aug 11, 2023

Description of the bug

Putting TextField to LAZY value change mode causes and obsolete server round-trip, even if the textfield is not used

Expected behavior

No extra request should be caused.

Minimal reproducible example

Use this UI with web inspector open and check the network tab. Ideally there should be only 1 (or 0) XHRs, but there is three. This bug causes one, #17428 causes another. Don't go focusing-blurring the textfield because you will get confused becase of #17429.

@Route
public class MainView extends VerticalLayout {

    public MainView() {
        TextField textField = new TextField();
        textField.setValueChangeMode(ValueChangeMode.LAZY);
        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

@TatuLund
Copy link
Contributor

I think this related to vaadin/flow-components#4986

@mstahv
Copy link
Member Author

mstahv commented Aug 14, 2023

Maybe, but my example has not validators at all 🤷‍♂️

@caalador
Copy link
Contributor

Setting the valueChangeMode to LAZY adds a debounce timeout of TRAILING which seems to be the one that sends the extra XHR value change even if nothing has changed.

Mode TIMEOUT also sets a throttle debounce of LEADING so that also sends an value-changed event, but earlier than LAZY

@mstahv
Copy link
Member Author

mstahv commented Aug 15, 2023

We might want to double check if this issue is still there after: #17410 . I think I tried to verify it is, but with way too long days last week, I may have missed some "mvn vaadin:dance" 🤷‍♂️ And if it is still there, my guess is that this technically belongs to the components team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔖 Normal Priority (P2)
Development

No branches or pull requests

4 participants