Skip to content

Commit

Permalink
Merge pull request #139 from Saikedo/master
Browse files Browse the repository at this point in the history
Added parentWrapperStyle prop
  • Loading branch information
jasongaare authored Mar 21, 2022
2 parents 58e2b3a + 5f5e6f6 commit a5f85d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/tooltip.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ declare module 'react-native-walkthrough-tooltip' {

// Styles the View element that wraps the children to clone it
childrenWrapperStyle?: StyleProp<ViewStyle>;

// Styles the view element that wraps the original children
parentWrapperStyle?: StyleProp<ViewStyle>
}

export interface TooltipProps extends Partial<TooltipStyleProps> {
Expand Down
6 changes: 5 additions & 1 deletion src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,11 @@ class Tooltip extends Component {

{/* This renders the child element in place in the parent's layout */}
{hasChildren ? (
<View ref={this.childWrapper} onLayout={this.measureChildRect}>
<View
ref={this.childWrapper}
onLayout={this.measureChildRect}
style={this.props.parentWrapperStyle}
>
{children}
</View>
) : null}
Expand Down

0 comments on commit a5f85d1

Please sign in to comment.