question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[5.0.0-rc.9] SearchBar component not respecting default font

See original GitHub issue

Current behaviour

The Searchbar component is not utilizing the custom default font set in the RNP theme.

Expected behaviour

Component renders using the custom theme font.

How to reproduce?

Simply use the Searchbar component using a custom font.

Preview

I believe the issue lies here in the Searchbar component logic:

style={[
  styles.input,
  {
    color: textColor,
    ...(!isV3 && theme.fonts.regular),
    ...Platform.select({ web: { outline: 'none' } }),
  },
  inputStyle,
]}

What have you tried so far?

To circumvent this, Im using the inputStyle prop to override the incorrect default:

inputStyle={{
  fontFamily: theme.fonts.bodyLarge.fontFamily,
}}

Your Environment

software version
ios x
android x
react-native x.x.x
react-native-paper 5.0.0-rc.9
node x.x.x
npm or yarn x.x.x
expo sdk x.x.x

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bombillazocommented, Nov 8, 2022

Sure, what branch should I use as base and to what branch should I create the PR?

1reaction
lukewalczakcommented, Nov 8, 2022

Hey @bombillazo, would you like to handle the support for it in the Searchbar, by adding the ternary expression there theme.isV3 ? theme.fonts.default : theme.fonts.regular?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the font size of UISearchBar - ios - Stack Overflow
I suggest yet a different option for iOS 5.0 and up: [[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setFont:[UIFont systemFontOfSize:14 ...
Read more >
@mui/system | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Titanium SDK 9.3.0.RC - 1 December 2020
Titanium SDK 9.3.0 is a minor release of the SDK, addressing high-priority issues from previous releases. As of this release, Titanium SDK 9.2.x...
Read more >
Deploy Red Hat Quay on OpenShift with Quay Operator
It is recommended that you install the Operator cluster-wide. If you choose a single namespace, the monitoring component will not be available by...
Read more >
material-ui/core/CHANGELOG.md - UNPKG
9, - System package 💎 & Box component 🛠️ ... Following our API guideline, we can no longer use a boolean property, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found