mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
[ActivityIndicator] Add the onLayout prop to the outer container view
Summary: ActivityIndicator was forwarding all of its props except `style` to the inner native view. This meant that onLayout would report a zero-sized frame that was relative to the wrapper view instead of the parent of the ActivityIndicator. This diff adds `onLayout` to the wrapper view instead of the native view. In general, all components that forward props need to be audited in this manner. Closes https://github.com/facebook/react-native/pull/1292 Github Author: James Ide <ide@jameside.com> Test Plan: `<ActivityIndicator onLayout={...} />` reports the size of the spinner plus a position relative to its parent view.
This commit is contained in:
@@ -99,6 +99,12 @@ var Image = React.createClass({
|
||||
* testing scripts.
|
||||
*/
|
||||
testID: PropTypes.string,
|
||||
/**
|
||||
* Invoked on mount and layout changes with
|
||||
*
|
||||
* {nativeEvent: { layout: {x, y, width, height}}}.
|
||||
*/
|
||||
onLayout: PropTypes.func,
|
||||
},
|
||||
|
||||
statics: {
|
||||
|
||||
Reference in New Issue
Block a user