NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Nested text issue on iOS platform

Open anazaim77 opened this issue 2 years ago • 5 comments

Description

appearance on iOS is different from android and web

CodeSandbox/Snack link

https://codesandbox.io/s/practical-night-4uq15g?file=/src/components/Example.tsx

Steps to reproduce

Execute this following code

      <Text fontWeight={"bold"}>Taj Mahal</Text>
      <Text>
        <Text fontWeight={"bold"}>Taj Mahal</Text> is in Agra.
      </Text>
      <Text bold>
        Taj Mahal <Text bold={false}>is in Agra.</Text>
      </Text>

NativeBase Version

3.4.4

Platform

  • [ ] Android
  • [ ] CRA
  • [X] Expo
  • [X] iOS
  • [ ] Next

Other Platform

No response

Additional Information

Hi, I've just created simple nested styling text. it works fine on android and web but not on ios.

image

as you can see in the image I attached above, on iOS it looks like there is no change in the word "Taj Mahal".

Code

      <Text fontWeight={"bold"}>Taj Mahal</Text>
      <Text>
        <Text fontWeight={"bold"}>Taj Mahal</Text> is in Agra.
      </Text>
      <Text bold>
        Taj Mahal <Text bold={false}>is in Agra.</Text>
      </Text>

native-base: 3.4.4 expo: 43.0.0 react-native: tested on 0.64.3 & 0.68.2

anazaim77 avatar Aug 23 '22 09:08 anazaim77

Hey @anazaim77, I wasn't able to reproduce the issue. Can please try using the latest version?

ankit-tailor avatar Aug 24 '22 12:08 ankit-tailor

It's also not working for me on iOS. The nested Text elements don't show any difference in styling.

native-base: 3.4.16 expo: 46.0.10 react-native: 0.69.5

flangfeldt avatar Sep 26 '22 00:09 flangfeldt

@ankit-tailor I do have this issue as well on iOS. Nested text styling such as Italics, and bold doesn't work but changing colors does.

native-base: 3.4.19 expo: 45.0.0 react-native: 0.68.2

saharsh-bhatia avatar Oct 26 '22 21:10 saharsh-bhatia

I think I have a related issue. Setting the font on the inner Text causes the font to not be recognised. I suspect it might be changing the font-weight to one that doesn't exist in my theme, but I can't work out the issue because I have all the major font weights specified, and some fonts don't have the same issue. The same thing happens on Android, but rather than crashing it just uses a default font.

    "native-base": "3.4.25",
    "react": "18.2.0",
    "react-native": "0.71.2",
  1. Font set on outer text, no issue Screenshot 2023-02-23 at 10 38 17 am
  2. Font set on inner text, crash Screenshot 2023-02-23 at 10 40 59 am
  3. On dismissing the error, it's using a fallback font Screenshot 2023-02-23 at 10 42 02 am

dannykennedy avatar Feb 23 '23 18:02 dannykennedy

Im having the same issue

varelycode avatar Mar 16 '23 19:03 varelycode