Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Commit

Permalink
Do not use Label when not labeling input fields (#65)
Browse files Browse the repository at this point in the history
* Do not use Label when not labeling input fields

Label should only be used when labeling input fields.
See
vaadin/flow#3532
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label

* Do not use Label when not labeling input fields
  • Loading branch information
Wnt authored and Denis committed Apr 5, 2018
1 parent 3e2e946 commit bc204bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Example:

[source,java]
----
Label label = new Label("My label");
Span label = new Span("My label");
label.setVisible(false);
// this is not transmitted to the client side
label.setText("Changed my label");
Expand All @@ -61,7 +61,7 @@ Example:

[source,java]
----
Label label = new Label("My label");
Span label = new Span("My label");
label.setVisible(false);
Div container = new Div();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.component.html.Label;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.polymertemplate.Id;
import com.vaadin.flow.tutorial.annotations.CodeFor;

Expand All @@ -31,7 +31,7 @@ public class ComponentBasicFeatures {
private Component mappedComponent;

public void visibility() {
Label label = new Label("My label");
Span label = new Span("My label");
label.setVisible(false);
// this is not transmitted to the client side
label.setText("Changed my label");
Expand All @@ -58,7 +58,7 @@ public void visibility() {
}

public void id() {
Label component = new Label();
Span component = new Span();
component.setId("my-component");
}

Expand Down

0 comments on commit bc204bd

Please sign in to comment.