react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

KeyboardTrackingView - addBottomView - can't set color

Open hirbod opened this issue 2 years ago • 5 comments

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

  • [x] Components
  • [ ] Demo
  • [ ] Docs
  • [ ] Typings

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

  • React Native: 0.64.3
  • React Native UI Lib: 6.11

Affected platforms

  • [ ] Android
  • [x] iOS
  • [ ] Web

hirbod avatar Mar 16 '22 01:03 hirbod

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,
        }}
      />
</>

brod-ie avatar Mar 24 '22 17:03 brod-ie

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

hirbod avatar Mar 24 '22 17:03 hirbod

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

brod-ie avatar Mar 25 '22 16:03 brod-ie

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.

hirbod avatar Mar 25 '22 17:03 hirbod

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

Inbal-Tish avatar Apr 26 '22 09:04 Inbal-Tish