react-native-segmented-control / segmented-control

React Native SegmentedControl library
MIT License
549 stars 85 forks source link

ios: Not selected tab gets bold face when setting fontSize #80

Closed gabriprat closed 4 years ago

gabriprat commented 4 years ago

Bug

When you add the fontSize attribute the non-selected tabs font-weight is bold instead of normal.

Environment info

react-native info output:

info Fetching system and libraries information...
System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz
    Memory: 62.67 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.15.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.7.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /Users/gabriprat/.rvm/gems/ruby-2.5.7/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 26, 28, 29
      Build Tools: 22.0.1, 26.0.3, 27.0.3, 28.0.0, 28.0.3, 29.0.0, 29.0.2
      System Images: android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_92 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 1.5.0

Steps To Reproduce

  1. Create a segmented control and set fontSize
  2. Execute on ios
  3. All tabs have boldface

Describe what you expected to happen:

  1. Only the selected tab should have boldface

Reproducible sample code

<SegmentedControl values={['One', 'Two']} fontSize={13} />
Naturalclar commented 4 years ago

@gabriprat Thanks for creating the issue and making a PR to fix it! I've published v1.6.1 that includes the fix :tada: