CptFabulouso Github contribution chart
CptFabulouso Github Stats
CptFabulouso Most Used Languages

Activity

03 Oct 2022

CptFabulouso

CardField font size scales with system font size on Android

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

Forked On 03 Oct 2022 at 01:14:47

CptFabulouso

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

Commented On 03 Oct 2022 at 01:14:47

CptFabulouso

Documentation to test the components

Thank you for building this amazing library. I am trying to test the components wrapped under the ThemeProvider but I am not sure how I can access the theme properties from the useTheme() hook while testing.

So far, I have come up with:

const customRender = (
  ui: React.ReactElement,
  {
    preloadedState,
    store = setupStore(preloadedState),
    ...options
  }: ExtendedRenderOptions = {},
) => {
  const { useTheme, useThemeDispatch, ThemeProvider } = initThemeProvider({
    themes,
    initialTheme: ColorScheme.light,
  });

  const Wrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => {
    return (
      <Provider store={store}>
        <ThemeProvider>{children}</ThemeProvider>
      </Provider>
    );
  };

  return {
    store,
    useTheme,
    useThemeDispatch,
    ...render(ui, { wrapper: Wrapper, ...options }),
  };
}; 

But, I realised I cannot use the useTheme() within the test cases.

What I can do is use renderHook from @testing-library/react-hooks, export the Wrapper from customRender and then:

const result = renderHook(useTheme, { wrapper: Wrapper })
console.log(result.current.t.palette) 

but I am not sure if this is the right approach to be followed for this library. Any help would be much appreciated. Thanks!

Forked On 23 Sep 2022 at 06:14:46

CptFabulouso

Hi, this lib is missing any test cases (as you probably found out), because honestly I haven't done many of them and none of those few tests was working with hooks, so I have minimal knowledge in that area and therefore there is no right approach at the moment. From what I read in the past, you need to use some lib (e.g. the @testing-library/react-hooks) for testing hooks and the code you posted looks good by the look. I'd be grateful if you'll post test cases you created covering this lib (or create MR), I don't want to promise to expand on them and make more test, but it'll surely help me start.

Commented On 23 Sep 2022 at 06:14:46

CptFabulouso

react navigation header issue repro

On 14 Sep 2022 at 05:21:14

CptFabulouso

react navigation header issue repro

On 14 Sep 2022 at 05:20:32

CptFabulouso

Bump version

Pushed On 06 Sep 2022 at 07:20:54

CptFabulouso

Fix double commas

Pushed On 06 Sep 2022 at 07:19:40

CptFabulouso

Add a way to clear the picker

Is your feature request related to a problem? Please describe. I have a form that needs to be cleared if its valid and ready to send. The only problem is that I can't seem to clear the picker/reset the state of the picker

Describe the solution you'd like I want a option to programmatically clear the input

Describe alternatives you've considered I tried to use some other packages but this ones looks the best.

Additional details N.A.

Forked On 29 Jul 2022 at 07:14:18

CptFabulouso

That won't clear the input, because the value prop

Will attempt to locate a matching item from the items array by checking each item's value property. If found, it will update the component to show that item as selected. If the value is not found, it will default to the first item.

Commented On 29 Jul 2022 at 07:14:18
Issue Comment

CptFabulouso

Android App crash - React Native Flipper

🐛 Bug Report

Following the React Native guide in the repo, Main Activity invokes the ReactNativeFlipper class. After creating a client and setting up some plugins, the app consistently crashes after client.start() run. I tried to use the debugger but even a force step into client.start() crashes immediately.

Crashes with

A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x13 in tid 8831 (FlipperEventBas), pid 8540 (tion.androiddev) 

To Reproduce

Flipper v0.127.0 ReactNativeFlipper.java from here

Environment

Flipper desktop Version 0.127.0 (50.0.0) Flipper SDk version 0.127.0 M1 Macbook

Forked On 25 Jul 2022 at 03:01:58

CptFabulouso

Uninstalling the app and installing it again helped me, as stated here (not sure how often it's needed)

Commented On 25 Jul 2022 at 03:01:58

CptFabulouso

BEWARE of the linked fork in the readme

If you do not target Android 12 and your app is running on Android 12, the suggest fork Salt-PepperEngineering/react-native-nordic-dfu will somehow remove BLUETOOTH_CONNECT and BLUETOOTH_SCAN permissions (which are granted automatically if you do not target Android 12), leading to your app crashing whenever using Bluetooth.

Forked On 11 Jul 2022 at 08:28:48

CptFabulouso

After using the forked version our app started to crash because of this Need android.permission.BLUETOOTH_CONNECT permission for AttributionSource { uid = 10052, packageName = com.xxx.app, attributionTag = null, token = android.os.BinderProxy@f8ab6f, next = null }: AdapterService getBondedDevices I was able to replicate the issue on my side by first installing the last working version of our app, then installing new version with the forked lib (the only thing changed) and the app crashed. our gradle

buildToolsVersion = "30.0.3"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
supportLibVersion = "28.0.0"
playServicesVersion = "17.0.0"
androidMapsUtilsVersion = "2.3.0" 

Not sure why we have compileSdkVersion set to 31 right now, could that be the reason?

Besides this lib we are using react-native-ble-manager: 7.6.3 for bluetooth. react-native: 0.6.3

Commented On 11 Jul 2022 at 08:28:48