google-pay / google-pay/google-pay-button
Button doesn't respect "plain" type sometimes, rendering a long version with card info
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 305
- Forks
- 90
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 7
Description
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:
- Open Chrome in incognito mode
- Go to modified jsfiddle Basic Example
- 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
Incorrectly rendered button
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)
- React component (
- 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 https://github.com/google-pay/google-pay-button/issues/292#issuecomment-2135879938, passing a deprecated buttonType: 'short' works as expected
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the @google-pay/button-react implementation and reproduce the modified jsfiddle Basic Example, including on Android Chrome. Trace how buttonType: 'plain' selects card information and sizing, then verify that plain buttons omit card info and do not impose the min-width: 240px rule in narrow layouts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, payments
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100