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

border top/left/bottom/right width not working

Open jlongster opened this issue 11 years ago • 49 comments

I have this in my render method:

    return View(
      { style: { flex: 1 } },
      TouchableWithoutFeedback(
        { onPress: this.handlePress },
        View({
          style: {
            flex: 0,
            backgroundColor: 'gray',
            height: 50,
            alignItems: 'center',
            justifyContent: 'center',
            borderWidth: 1,
            borderColor: 'white'
          },
        }, Text({ style: { color: 'white' }}, "^"))
      ),
      TouchableWithoutFeedback(
        { onPress: this.handlePress },
        View({
          style: {
            flex: 0,
            backgroundColor: 'gray',
            height: 50,
            alignItems: 'center',
            justifyContent: 'center'
          },
        }, Text({ style: { color: 'white' }}, "v"))
      )
    )

It renders this:

screen shot 2015-02-02 at 9 43 33 am

But if I change the borderWidth in the first component to borderBottomWidth or any of the other top/left/bottom/right methods, there is no border. There should be a white border on one side of the component:

screen shot 2015-02-02 at 9 43 40 am

jlongster avatar Feb 02 '15 14:02 jlongster

Yup, you noticed! So, the story here is that borders on only one side are not natively supported by iOS, we did some bad hacks in our fb codebase to support it.

We want to rewrite it cleanly in OSS. Make sure it supports borderRadius, and does the same diagonal appearance when there are two adjacent borders with a different color/size.

vjeux avatar Feb 02 '15 15:02 vjeux

Should be working now

vjeux avatar Apr 01 '15 02:04 vjeux

It's not yet working for me (on 0.4.0)

janmonschke avatar Apr 21 '15 15:04 janmonschke

Argh, nevermind, Apparently it is not activated for <Text /> nodes and I'm now wrapping a <View /> around them.

janmonschke avatar Apr 27 '15 09:04 janmonschke

Can confirm that this works in 0.8.0 for <View />

But is there a reason why it doesn't support <Text />?

axelg12 avatar Jul 28 '15 00:07 axelg12

+1 for <Text /> support

mikefrancis avatar Sep 17 '15 15:09 mikefrancis

:+1: I need this for <TextInput />

JeanLebrument avatar Oct 08 '15 15:10 JeanLebrument

+1 for <TextInput />

ilansas avatar Oct 27 '15 17:10 ilansas

+1 for <Text />

elisei-timofte avatar Oct 29 '15 14:10 elisei-timofte

Any news on support for <Text />?

AlexGustafsson avatar Oct 29 '15 19:10 AlexGustafsson

+1 for <TextInput /> as well

chinloongtan avatar Nov 03 '15 16:11 chinloongtan

Can you add it to https://productpains.com/product/react-native/ so that we can figure out prioritization?

vjeux avatar Nov 03 '15 16:11 vjeux

fyi: https://productpains.com/post/react-native/add-borderwidth-left-right-top-bottom-to-textinput-/

mhollweck avatar Nov 04 '15 14:11 mhollweck

+1

leeight avatar Nov 17 '15 06:11 leeight

@ide, you guys don't have labels for these types of issues?

rclai avatar Dec 10 '15 20:12 rclai

Definitely need it for <TextInput />

akshaysmurthy avatar Dec 13 '15 08:12 akshaysmurthy

+1 on <TextInput />

jorilallo avatar Jan 06 '16 08:01 jorilallo

+1 <TextInput />

kelvinlauKL avatar Jan 12 '16 22:01 kelvinlauKL

+1 <TextInput />, Googling brought me to this issue.

Overload119 avatar Jan 26 '16 14:01 Overload119

Ugh, spent hours banging my head against the wall trying to figure this out before I found this... +1 gajillion to make this work everywhere the docs say it should, like TextInput...

claytongulick avatar Feb 10 '16 01:02 claytongulick