LinkButton should render the label in a <span> element
See original GitHub issueDescribe the bug
The <LinkButton>
renders the label in a <Text.Body>
element, which defaults to <p>
.
This becomes problematic when the <LinkButton>
is rendered within a paragraph text, as nested <p>
are not valid.
To Reproduce
https://codesandbox.io/s/k06ln8z2xr
Expected behavior
The <LinkButton>
should render the label within a <span>
element
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
CSS. Link button from <span> tag - Stack Overflow
Sorry for noob question. I can't figure out how to create a link button. I want that two span tags to be inline,...
Read more >Do not render <span> tag for ASPxButton in RenderMode ...
Turns out that ASPxButton renders text inside a <span> </span>. It is possible to make it render just text, same as a regular...
Read more >A Complete Guide to Links and Buttons - CSS-Tricks
Our complete guide to links, buttons, and button-like inputs in HTML, CSS, and JavaScript.
Read more ><input type="button"> - HTML: HyperText Markup Language
Given that a <button> 's label text is inserted between the opening and closing tags, you can include HTML in the label, even...
Read more >Telerik UI for ASP.NET AJAX - Button Types
LinkButton (Figure 2). The control is rendered as a <span/> element with child <span/> element used to specify the text. The purpose of...
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
Agreed. I would however also keep suggesting to have all
Text.*
components have anas
prop which referes to the component used for rendering. It avoids us having to “break out” of being able to use the Text components in some cases only cause their wrapper is not “fitting”. TheLinkButton
would just render<Text.Body as="span">...</Text.Detail/>
.Yes I agree. Even though I might seem to play the devil’s advocate here, I find the
as
prop also nicer to have.I’m just asking those questions mainly to avoid us spending too much time dealing with migrations and to also take the chance to maybe evaluate how we can improve the API of the text components.
If we proceed with the “renaming”, to keep things simple I would maybe prefer to do it like:
as
prop, without deprecating anything elseelementType
,isInline
, etc)I think this way we don’t need anyone to “force” migrating the props when we introduce the
as
prop.That’s my point of view.