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

CardField font size scales with system font size on Android & iOS #911

Open
saf94 opened this issue Apr 28, 2022 · 3 comments
Open

CardField font size scales with system font size on Android & iOS #911

saf94 opened this issue Apr 28, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@saf94
Copy link

saf94 commented Apr 28, 2022

Describe the bug
The font size of the CardField seems to scale with the system font size on Android. A few of our users are having issues with overlapping text in the fields because they have set their system font to be bigger than standard. I'm not sure if this is intended or not, but is there a way to disable the font scaling? As none of the rest of our app font scales, and i dont think this happens on iOS

To Reproduce
Steps to reproduce the behavior:

  1. Set system font size to be very large on an Android device
  2. Render the card field
  3. Add in card details
  4. See text will overlap

Expected behavior
Maybe it shouldn't scale or there could be an option to disable scaling?

Screenshots
image

Smartphone (please complete the following information):

  • Device: tested on Samsung Galaxy S21 but also happens on other Android phones
  • OS: Android
@saf94 saf94 changed the title CardField font size scales with system font size CardField font size scales with system font size on Android Apr 28, 2022
@charliecruzan-stripe
Copy link
Collaborator

Can you provide some sample code to reproduce this? If you can, I will close #773 in favor of this issue

@charliecruzan-stripe charliecruzan-stripe added the reproduce Try and reproduce the issue label Apr 28, 2022
@saf94
Copy link
Author

saf94 commented Apr 29, 2022

This is the way we're rendering the CardField

const AddPaymentCard = () => {
  ...
  return (
    <CardField
      style={{ height: 20 }}
      cardStyle={{
        fontSize: 16,
      }}
      autofocus
    />
  )
}

Is that what you need? I think it pretty much would happen on any CardField component if the system font size is large enough

@charliecruzan-stripe charliecruzan-stripe added enhancement New feature or request and removed reproduce Try and reproduce the issue labels Jul 11, 2022
@CptFabulouso
Copy link

As a workaround, the scaling can be "disabled" using react-native-device-info by setting fontSize:
fontSize: 14 / DeviceInfo.getFontScaleSync()

@charliecruzan-stripe charliecruzan-stripe changed the title CardField font size scales with system font size on Android CardField font size scales with system font size on Android & iOS Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants