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

TextInputProp "maxFontSizeMultiplier" has no effect #93

Open
smiddleton93 opened this issue Jan 28, 2025 · 2 comments
Open

TextInputProp "maxFontSizeMultiplier" has no effect #93

smiddleton93 opened this issue Jan 28, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@smiddleton93
Copy link

Describe the bug
TextInputProp "maxFontSizeMultiplier" has no effect

To Reproduce
Steps to reproduce the behavior:

  1. Increase max font size in settings
  2. Add maxFontSizeMultiplier prop
  3. Add input values
    <OtpInput
      numberOfDigits={6}
      textInputProps={{
        maxFontSizeMultiplier: 1.5,
      }}

Expected behavior
The input text shouldn't scale beyond the max font size

Screenshots

Image

Environment (please complete the following information):
iOS iPhone 16

@smiddleton93 smiddleton93 added the bug Something isn't working label Jan 28, 2025
@anday013
Copy link
Owner

Hey @smiddleton93 . Hmm, a pretty valid point. The reason of the issue is that maxFontSizeMultiplier should be assigned to the Text component (https://github.com/anday013/react-native-otp-entry/blob/main/src/OtpInput/OtpInput.tsx#L93) that actually shows digits on the screen, not to TextInput.

Solution: To expose props of the underneath Text component as a new prop in OtpInput (ex. textProps)

@smiddleton93
Copy link
Author

Hey @smiddleton93 . Hmm, a pretty valid point. The reason of the issue is that maxFontSizeMultiplier should be assigned to the Text component (https://github.com/anday013/react-native-otp-entry/blob/main/src/OtpInput/OtpInput.tsx#L93) that actually shows digits on the screen, not to TextInput.

Solution: To expose props of the underneath Text component as a new prop in OtpInput (ex. textProps)

Thanks for the reply! That makes sense now why that prop isn't going to do anything.
Being able to set a max font size for this would be very helpful for me, I have a lot of elderly and vision impaired users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants