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

Deprecation Warning because of use of Label in FormLayout #5209

Closed
simasch opened this issue Jun 30, 2023 · 2 comments
Closed

Deprecation Warning because of use of Label in FormLayout #5209

simasch opened this issue Jun 30, 2023 · 2 comments

Comments

@simasch
Copy link

simasch commented Jun 30, 2023

Description

I see a lot of these messages:

The Label 'Username' was not associated with a component. Labels should not be used for loose text on the page. Consider alternatives like Text, Paragraph, Span or Div. See the JavaDocs and Deprecation Warning for more Information.

The reason is that FormLayout still uses Label:

public FormItem addFormItem(Component field, String label) {
    return addFormItem(field, new Label(label));
}

Expected outcome

FormLayout should not use deprecated classes.

Minimal reproducible example

FormLayout loginForm = new FormLayout();
loginForm.setResponsiveSteps(new FormLayout.ResponsiveStep("0", 1));

TextField username = new TextField();
FormLayout.FormItem formItem = loginForm.addFormItem(this.username, "Username");

Steps to reproduce

Add the snipped above an run the app

Environment

Vaadin version(s): 24.1.1

Browsers

Issue is not browser related

@web-padawan
Copy link
Member

Duplicate of #5171

@web-padawan web-padawan marked this as a duplicate of #5171 Jun 30, 2023
@web-padawan web-padawan closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2023
@simasch
Copy link
Author

simasch commented Jun 30, 2023

@web-padawan Thanks. For some reason I didn't find the issue from knoobie 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants