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.

Default button is causing issues on components that use Button

See original GitHub issue

With the new changes that were done to Button and default this is now effecting other components in which use Button under the hood to made up that component

Expected Behavior

I would expect that if I had certain properties defined in theme for default button these would not effect the components that are should be using plain button under the hood.

Actual Behavior

When you have in your theme

  button: {
    default: {
      color: 'text',
      border: undefined,
      padding: {
        horizontal: '12px',
        vertical: '6px',
      },
    },

This will also effect the padding in accordion and select since these components are using button there is unnecessary pad now in which the user would want the plain button to still be used in accordion

URL, screen shot, or Codepen exhibiting the issue

Steps to Reproduce

Currently there is a theme story for accordion if you make sure you have the latest master changes and grommet-theme-hpe-next changes you will see the hover behavior and the extra padding of 12px horizontal and 6px vertical.

In accordionpanel.js Button is being used on line 90 and so if you set that button prop plain then that will fix the issue.

I would assume that we would want to ignore these default props given to button if they are being used inside other components.

Your Environment

  • Grommet version: [Shimi] stable branch
  • Browser Name and version: [Shimi] any
  • Operating System and version (desktop or mobile): [Shimi] any

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
britt6612commented, Jun 25, 2020

@ShimiSun this can be closed! The problem was fixed!

1reaction
ShimiSuncommented, Jun 1, 2020

A fix for this issue is now available on the stable branch, let us know if you need us to address anything else in this area, before closing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Material buttons should default to type="button" · Issue #9669
If type="button" is not added to buttons in a form, then they are treated as submit elements and the first will trigger when...
Read more >
React Native styled-components issue : typerror:_native. ...
Here's a piece of code using the styled.button method. import styled from 'styled-components/native'; import React ...
Read more >
The Button element - HTML: HyperText Markup Language
Clicking and focus​​ Whether clicking on a <button> or <input> button types causes it to (by default) become focused varies by browser and...
Read more >
Button component text changes back to default on hover
Hello, I created a button component with a hover state. In the component, I added a default text 'text' which is also the...
Read more >
Button | Components | Vaadin Docs
Size variants should only be used in special cases. See Size and Space for details on how to change the default button size....
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