Skip to content

Commit 03c7bb7

Browse files
committed
Fix inline-flex for view inside text
1 parent f37b71f commit 03c7bb7

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/utils/rnw-compat/BaseView.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ const defaultProps = {
4040
styleName: null,
4141
};
4242

43-
const styles = StyleSheet.create({
44-
inline: {
45-
display: 'inline-flex',
46-
},
47-
});
48-
4943
const calculateHitSlopStyle = (hitSlop) => {
5044
const hitStyle = {};
5145

@@ -97,17 +91,16 @@ class BaseView extends Component {
9791
supportedProps.className = cx(
9892
// add yoga layout styles
9993
!pseudo && 'yv',
94+
// add flex-inline if inside text
95+
isInAParentText && 'yv-inline',
10096
// add (mostly) bootstrap styles
10197
className,
10298
// add custom styles
10399
customClassName,
104100
// add utils styles
105101
createUtilityClasses(styleName),
106102
);
107-
supportedProps.style = StyleSheet.compose(
108-
isInAParentText && styles.inline,
109-
style,
110-
);
103+
supportedProps.style = StyleSheet.compose(style);
111104

112105
if (hitSlop) {
113106
const hitSlopStyle = calculateHitSlopStyle(hitSlop);

styles.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@
2727
display: flex;
2828
}
2929

30+
.yv-inline:not(.collapse):not(.carousel-item):not(.dropdown-menu):not(.modal):not(.navbar):not(.navbar-toggler):not(.navbar-collapse):not(.offcanvas):not(.tab-pane),
31+
.yv-inline.show {
32+
display: inline-flex !important;
33+
}
34+
35+
.yv-inline.navbar,
36+
.yv-inline.navbar-toggler,
37+
.yv-inline.navbar-collapse {
38+
display: inline-flex;
39+
}
40+
3041
.yv-hit-slop {
3142
position: absolute;
3243
top: 0;

0 commit comments

Comments
 (0)