Rename the current Label component to NativeLabel and create a new Label that is compatible with FW8 Label
See original GitHub issueCurrently the Label component creates a <label>
element in the client, which makes it not suitable to rendering loose text in the page, since the <label>
in meant to be used in conjunction with other elements (usually <input>
). This makes it semantically different from the old Label in FW8, which creates a <div>
instead.
On top of that, the <label>
element is an interactive content element, which makes it behave differently than a regular text in the page. For example, when used inside a Grid cell, clicking on a label doesn’t trigger the selection of the row (see https://github.com/vaadin/flow/issues/4313 for details).
My proposal to this issue is the following:
- Rename the current class from
Label
toNativeLabel
(using the same naming structure as theNativeButton
); - Create a new
Label
class that behaves exactly like the old Label from FW8; - Update demos and starters to use the new Label class;
- Update the documentation explaining the difference between those two classes.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Change text of label whenever UserDefaults key value changes
I have an app where there are 2 views, one with a UILabel and another with a UITextField. I would like it so...
Read more >how do I change text in a label with swift? - Stack Overflow
The idea is to write a message in a textField and have it change the label once I press a button. the objective-c...
Read more >Apply a label to anything in React Native - Morioh
Do you want fully customizable labels? Do you want to embed stateful components in your labels? Do you want to label your labels?...
Read more >UILabel Programmatically (Swift 4 + Xcode 9.0) - YouTube
In this video i will show how to create UI Label programmatically. I will show how to do:1) Text Alignment2) Label Background Color3)...
Read more >UILabel - Tasharen Entertainment
You can change the alignment of the labels simply by switching the Pivot ... making the font size shrink down, not just scaling...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wouldn’t rename
Label
. New developers approaching Vaadin will likely expectLabel
to be<label>
, asDiv
is<div>
andH1
is<h1>
, and FW8 users are being made well aware that many things changed in Flow to be more HTML-intuitive.I’d see more fit just a note in the
Label
JavaDoc warning about this.I see no reason to do any drastic changes anymore for this - yes it is something that existing (or swing based) users run into, but there has not really been that much questions and uproar on this topic that would make us want to change things anymore.
So I’m quite close to closing this as won’t fix.