Skip to content

Commit 1b9fbdf

Browse files
authored
Hint - Hide mocked children (#3194)
* hidden the mocked children so they wont be visible * Revert "hidden the mocked children so they wont be visible" This reverts commit 03974dc. * changed mockChildren opacity handling * moved opacity style to styles object
1 parent b112b5f commit 1b9fbdf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/hint/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ class Hint extends Component<HintProps, HintState> {
534534
}
535535

536536
renderMockChildren() {
537-
const {children} = this.props;
537+
const {children, backdropColor} = this.props;
538+
const isBackdropColorPassed = backdropColor !== undefined;
538539
if (children && React.isValidElement(children)) {
539540
const layout = {
540541
...this.getContainerPosition(),
@@ -545,7 +546,7 @@ class Hint extends Component<HintProps, HintState> {
545546
};
546547

547548
return (
548-
<View style={[styles.mockChildrenContainer, layout]}>
549+
<View style={[styles.mockChildrenContainer, layout, !isBackdropColorPassed && styles.hidden]}>
549550
{React.cloneElement<any>(children, {
550551
collapsable: false,
551552
key: 'mock',
@@ -609,6 +610,7 @@ const styles = StyleSheet.create({
609610
container: {
610611
position: 'absolute'
611612
},
613+
hidden: {opacity: 0},
612614
overlayContainer: {
613615
zIndex: 10,
614616
elevation: 10

0 commit comments

Comments
 (0)