Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RN] Optional use TouchableWithoutFeedback component in Flex/FlexItem component #2095

Merged
merged 3 commits into from Nov 29, 2017

Conversation

fengliu222
Copy link
Contributor

@fengliu222 fengliu222 commented Nov 19, 2017

relate issues: #1108, #769

Flex and FlexItem now have capability to switch that TouchableWithoutFeedback wrap or not.

When developer pass one of onPress onLongPress onPressIn onPressOut parameter, the Flex component will be wrapped by TouchableWithoutFeedback.

This solution avoid make a break change to developer.


This change is Reviewable

@codecov
Copy link

codecov bot commented Nov 19, 2017

Codecov Report

Merging #2095 into master will increase coverage by 0.08%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2095      +/-   ##
==========================================
+ Coverage    58.1%   58.19%   +0.08%     
==========================================
  Files         253      253              
  Lines        4399     4437      +38     
  Branches     1156     1174      +18     
==========================================
+ Hits         2556     2582      +26     
- Misses       1842     1854      +12     
  Partials        1        1
Flag Coverage Δ
#rn 60.78% <94.44%> (+0.36%) ⬆️
#web 55.95% <ø> (-0.17%) ⬇️
Impacted Files Coverage Δ
components/flex/demo/basic.native.tsx 80% <0%> (-20%) ⬇️
components/flex/FlexItem.native.tsx 95.23% <100%> (+2.38%) ⬆️
components/flex/Flex.native.tsx 97.43% <100%> (+0.56%) ⬆️
components/picker/AbstractPicker.tsx 69.35% <0%> (-5.65%) ⬇️
components/tab-bar/index.tsx 96.55% <0%> (-3.45%) ⬇️
components/textarea-item/index.tsx 48.38% <0%> (-1.62%) ⬇️
components/steps/demo/basic.native.tsx 100% <0%> (ø) ⬆️
components/steps/StepsItem.native.tsx 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2abf7ee...34a8faa. Read the comment docs.

@silentcloud
Copy link
Contributor

+1

@@ -10,23 +10,42 @@ export interface FlexItemProps extends BasePropsType {
onPressOut?: any;
}

export default class FlexItem extends React.Component<FlexItemProps, any> {
export default class FlexItem extends React.Component < FlexItemProps, any > {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need blank

static defaultProps = {
flex: 1,
};
render() {
let { style, children, flex, ...restProps } = this.props;
let {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommend: no need wrap within 100 columns

@paranoidjk
Copy link
Contributor

ping @fengliu222

@fengliu222
Copy link
Contributor Author

@paranoidjk I will fix in few hours.

@fengliu222
Copy link
Contributor Author

@paranoidjk Fixed, pls review.

@silentcloud silentcloud merged commit 663fb04 into ant-design:master Nov 29, 2017
@silentcloud
Copy link
Contributor

This is not a break change and can be released in next version.

@fengliu222 fengliu222 deleted the improve/rn-flex-item branch December 3, 2017 12:06
lixiaoyang1992 pushed a commit to lixiaoyang1992/ant-design-mobile that referenced this pull request Apr 26, 2018
ant-design#2095)

* Enhancement:[RN] Remove TouchableWithoutFeedback wrapper in `flexItem` and `flex` component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants