wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.44k stars 706 forks source link

KeyboardTrackingView - addBottomView - can't set color #1898

Closed hirbod closed 1 year ago

hirbod commented 2 years ago

Description

I am using KeyboardTrackingView. I added addBottomView since I have to use useSafeArea prop. Working extremely well, but the added bottomView is always white and I can't change the backgroundColor.

I've inspected the native code and its a fixed value https://github.com/wix/react-native-ui-lib/blob/6496cb2a5b18a42699bf4293eb31a80d131f2be8/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m#L452

Related to

Steps to reproduce

Add addBottomView to KeyboardTrackingVIew

Expected behavior

I should be able to set the color of addBottomView, either directly with backgroundColor via style, or as a separate prop bottomViewColor

Actual behavior

Can't set the color, it is always white

More Info

Code snippet

      <KeyboardTrackingView
        style={styles.trackingToolbarContainer}
        trackInteractive={true}
        addBottomView
        scrollToFocusedInput
        manageScrollView
        requiresSameParentToManageScrollView
        useSafeArea
      >

Screenshots/Video

IMG_01820F14BB1C-1

Environment

Affected platforms

brod-ie commented 2 years ago

I got around this with this hack:

<>
      <KeyboardAccessoryView
        ...
        addBottomView={false}
      />
      <View
        style={{
          backgroundColor: PlatformColor("systemBackground"),
          position: 'absolute',
          bottom: 0,
          right: 0,
          left: 0,
          height: useSafeAreaInsets().bottom,
        }}
      />
</>
hirbod commented 2 years ago

Thanks. I already made a PR working around this issue though.

brod-ie commented 2 years ago

Well if this PR never makes it in, above is an easy win!

hirbod commented 2 years ago

True. Tbh, I wish I had that hack handy while I was searching for a solution :D. It tooked way more time for me than I thought.

Inbal-Tish commented 2 years ago

@hirbod Hi. You can follow PR #2013 for this feature