Skip to content

Button doesn't respect "plain" type sometimes, rendering a long version with card info #296

Description

@atsikov

Describe the bug Button is rendered inconsistently when buttonType: 'plain' is used. Sometimes it still tries to include card information which results in min-width: 240px rule breaking narrow layouts.

To Reproduce Steps to reproduce the behavior:

  1. Open Chrome in incognito mode
  2. Go to modified jsfiddle Basic Example
  3. Observe a cut GPay button
    3.1 If button is rendered correctly, try to reload page a few times
    3.2 Alternatively, try to open a url with Android Chrome - the issue is always reproducible there

Parameters used to render the button (though it feels like buttonSizeMode and buttonRadius have no impact)

        buttonSizeMode: 'fill',
        buttonType: 'plain',
        buttonRadius: 9999,

Expected behavior Button respects passed parameters and doesn't try to render card info when buttonType: 'plain' is used

Screenshots
Correctly rendered button
Screenshot 2024-06-24 at 12 30 11
Incorrectly rendered button
Screenshot 2024-06-24 at 12 29 58

Component information:

Reproducible with a plain SDK. Initially found it with @google-pay/button-react however I believe it is applicable to other component libraries

  • Component
    • React component (@google-pay/button-react)
  • Component version (e.g. 1.0.0): 3.1.0

Environment:

  • Device: MacBook Pro M1 2021, Pixel 6 Pro
  • OS: MacOS 14.5, Android 14
  • Browser: Chrome MacOS 126, Safari MacOS 17.5, Chrome Android 126
  • Country/region: UK

Additional information
As mentioned in #292 (comment), passing a deprecated buttonType: 'short' works as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions