question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LinkButton should render the label in a <span> element

See original GitHub issue

Describe 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 image

https://codesandbox.io/s/k06ln8z2xr

Expected behavior The <LinkButton> should render the label within a <span> element

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
tdeekenscommented, Mar 5, 2019

Agreed. I would however also keep suggesting to have all Text.* components have an as 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”. The LinkButton would just render <Text.Body as="span">...</Text.Detail/>.

1reaction
emmenkocommented, Apr 5, 2019

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:

  • add the as prop, without deprecating anything else
  • in the next major we deprecate the other props (e.g. elementType, isInline, etc)
  • in the next major we remove the deprecate props

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found