Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion packages/react-native-web-examples/pages/text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ function LineExample({ description, children }) {

<View
style={{
borderWidth: 2,
borderWidth: 1,
borderColor: 'black',
width: 200
}}
Expand Down Expand Up @@ -462,6 +462,22 @@ export default function TextPage() {
</Text>
</LineExample>

<LineExample description="With reduced line height, vertical content is not clipped (1 line)">
<Text numberOfLines={1} style={{ lineHeight: 8 }}>
{
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\nExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
}
</Text>
</LineExample>

<LineExample description="With reduced line height, vertical content is not clipped (2 lines, not working)">
<Text numberOfLines={2} style={{ lineHeight: 8 }}>
{
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\nExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
}
</Text>
</LineExample>

<LineExample description="With space characters within adjacent truncated lines">
<View style={{ display: 'flex', flexDirection: 'row' }}>
<Text numberOfLines={1}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ describe('AppRegistry', () => {
.r-display-xoduu5{display:inline-flex;}
.r-flex-13awgt0{flex:1;}
.r-overflow-1qsk4np{overflow-x:clip;overflow-y:clip;}
.r-overflow-1udh08x{overflow-x:hidden;overflow-y:hidden;}
[stylesheet-group="3"]{}
.r-WebkitBoxOrient-8akbws{-webkit-box-orient:vertical;}
.r-bottom-1p0dtai{bottom:0px;}
.r-cursor-1loqt21{cursor:pointer;}
.r-left-1d2f490{left:0px;}
.r-maxWidth-dnmrzs{max-width:100%;}
.r-overflowInline-1b3bawr{overflow-inline:clip;}
.r-pointerEvents-105ug2t{pointer-events:auto!important;}
.r-pointerEvents-12vffkv>* {pointer-events:auto;}
.r-pointerEvents-12vffkv{pointer-events:none!important;}
Expand Down Expand Up @@ -112,13 +112,13 @@ describe('AppRegistry', () => {
.r-display-xoduu5{display:inline-flex;}
.r-flex-13awgt0{flex:1;}
.r-overflow-1qsk4np{overflow-x:clip;overflow-y:clip;}
.r-overflow-1udh08x{overflow-x:hidden;overflow-y:hidden;}
[stylesheet-group="3"]{}
.r-WebkitBoxOrient-8akbws{-webkit-box-orient:vertical;}
.r-bottom-1p0dtai{bottom:0px;}
.r-cursor-1loqt21{cursor:pointer;}
.r-left-1d2f490{left:0px;}
.r-maxWidth-dnmrzs{max-width:100%;}
.r-overflowInline-1b3bawr{overflow-inline:clip;}
.r-pointerEvents-105ug2t{pointer-events:auto!important;}
.r-pointerEvents-12vffkv>* {pointer-events:auto;}
.r-pointerEvents-12vffkv{pointer-events:none!important;}
Expand Down Expand Up @@ -163,14 +163,14 @@ describe('AppRegistry', () => {
.r-display-xoduu5{display:inline-flex;}
.r-flex-13awgt0{flex:1;}
.r-overflow-1qsk4np{overflow-x:clip;overflow-y:clip;}
.r-overflow-1udh08x{overflow-x:hidden;overflow-y:hidden;}
[stylesheet-group="3"]{}
.r-WebkitBoxOrient-8akbws{-webkit-box-orient:vertical;}
.r-backgroundColor-aot4c7{background-color:rgba(128,0,128,1.00);}
.r-bottom-1p0dtai{bottom:0px;}
.r-cursor-1loqt21{cursor:pointer;}
.r-left-1d2f490{left:0px;}
.r-maxWidth-dnmrzs{max-width:100%;}
.r-overflowInline-1b3bawr{overflow-inline:clip;}
.r-pointerEvents-105ug2t{pointer-events:auto!important;}
.r-pointerEvents-12vffkv>* {pointer-events:auto;}
.r-pointerEvents-12vffkv{pointer-events:none!important;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ exports[`components/Text prop "numberOfLines" value is set 1`] = `

exports[`components/Text prop "numberOfLines" value is set to one 1`] = `
<div
class="css-text-146c3p1 r-maxWidth-dnmrzs r-overflow-1udh08x r-textOverflow-1udbk01 r-whiteSpace-3s2u2q r-wordWrap-1iln25a"
class="css-text-146c3p1 r-maxWidth-dnmrzs r-overflowInline-1b3bawr r-textOverflow-1udbk01 r-whiteSpace-3s2u2q r-wordWrap-1iln25a"
dir="auto"
/>
`;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-web/src/exports/Text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const styles = StyleSheet.create({
},
textOneLine: {
maxWidth: '100%',
overflow: 'hidden',
overflowInline: 'clip',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
wordWrap: 'normal'
Expand Down
Loading