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

Button component default class #4638

Closed
schlessera opened this issue Jan 23, 2018 · 3 comments
Closed

Button component default class #4638

schlessera opened this issue Jan 23, 2018 · 3 comments
Labels
[Feature] UI Components Impacts or related to the UI component system [Type] Bug An existing feature does not function as intended

Comments

@schlessera
Copy link
Member

Issue Overview

The <Button> component does not contain the default button class when it is not specified to be "Primary" or "Large".

This causes a generic <Button> component to not be displayed like a button at all, but rather like a link.

Steps to Reproduce (for bugs)

<Button className="some-button"> will render as a standard link.

To produce a button that actually looks like one, without making it large or primary, you need to use something like this:

<Button className="some-button button"> will render as a standard link.

Expected Behavior

I'd expect the <Button> component to render as a button by default.

Current Behavior

The <Button> component renders as a link by default.

Possible Solution

Make sure the button class is added by default, and provide a specific method of disabling this behavior, like an isLink property.

@schlessera schlessera added [Feature] UI Components Impacts or related to the UI component system [Component] Button labels Jan 23, 2018
schlessera added a commit that referenced this issue Jan 23, 2018
Note: the `<Button>` component does not add the `button` class by default, so I added it manually. See #4638
@danielbachhuber danielbachhuber added the [Type] Bug An existing feature does not function as intended label Jan 23, 2018
@danielbachhuber
Copy link
Member

Included in #3418, for the next person looking.

pento pushed a commit that referenced this issue Jan 24, 2018
Note: the `<Button>` component does not add the `button` class by default, so I added it manually. See #4638
schlessera added a commit that referenced this issue Mar 8, 2018
Note: the `<Button>` component does not add the `button` class by default, so I added it manually. See #4638
@jorgefilipecosta jorgefilipecosta self-assigned this Apr 19, 2018
@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Apr 19, 2018

Hi @schlessera thank for creating this detailed issue.

Rendering a button with button class by default causes many UI implications:

image

I think the button component when no "style prop" is passed is more of semantic than style nature. It represents a button but it is up the component user to style it.
Adding a default button class would be other option, but I fear now the change may not be worth the trouble as adding the class by default would create lots of issues and would break back compatibility for external developers using the button without the prop.

@jorgefilipecosta jorgefilipecosta removed their assignment Apr 19, 2018
@jorgefilipecosta
Copy link
Member

I will close this issue for now if someone has new inputs to add, feel free to reopen the issue so we can discuss further!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants