Skip to content

Commit

Permalink
Add baseline alignment support
Browse files Browse the repository at this point in the history
Summary:
Add baseline alignment support to react native.

{F65372439}

```
class Playground extends React.Component {
  render() {
    return (
      <View style={{padding: 30, flexDirection: 'row', alignItems: 'baseline'}}>
        <View style={{width: 30, height: 10, backgroundColor: 'red'}}/>
        <View style={{width: 30, height: 20, backgroundColor: 'green'}}/>
        <View style={{width: 30, height: 30, backgroundColor: 'blue'}}/>
      </View>
    );
  }
}
```

Reviewed By: javache

Differential Revision: D4385099

fbshipit-source-id: d7caa6e4c086c4a62e24ef1d5db9c805c470ef2a
  • Loading branch information
Emil Sjolander authored and facebook-github-bot committed Jan 8, 2017
1 parent e3c8d80 commit 976abf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Libraries/StyleSheet/LayoutPropTypes.js
Expand Up @@ -311,7 +311,8 @@ var LayoutPropTypes = {
'flex-start',
'flex-end',
'center',
'stretch'
'stretch',
'baseline'
]),

/** `alignSelf` controls how a child aligns in the cross direction,
Expand All @@ -325,7 +326,8 @@ var LayoutPropTypes = {
'flex-start',
'flex-end',
'center',
'stretch'
'stretch',
'baseline'
]),

/** `overflow` controls how a children are measured and displayed.
Expand Down
3 changes: 2 additions & 1 deletion React/Base/RCTConvert.m
Expand Up @@ -640,7 +640,8 @@ + (NSPropertyList)NSPropertyList:(id)json
@"flex-end": @(YGAlignFlexEnd),
@"center": @(YGAlignCenter),
@"auto": @(YGAlignAuto),
@"stretch": @(YGAlignStretch)
@"stretch": @(YGAlignStretch),
@"baseline": @(YGAlignBaseline)
}), YGAlignFlexStart, intValue)

RCT_ENUM_CONVERTER(YGPositionType, (@{
Expand Down

0 comments on commit 976abf8

Please sign in to comment.