File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,13 @@ map.set({}, 'world')
6969const set = new Set ( [ 1 , 2 , 3 ] )
7070
7171const superLongString = '1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'
72+ const shortMultiLineString = `Line 1
73+ Line 2
74+ Line 3`
75+ const multiLineString = `Lorem ipsum dolor sit amet,
76+ consectetur adipiscing elit.
77+ Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
78+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.`
7279
7380const example = {
7481 avatar,
@@ -101,6 +108,8 @@ const example = {
101108 [ 3 , 4 ]
102109 ] ,
103110 superLongString,
111+ shortMultiLineString,
112+ multiLineString,
104113 function : aPlusB ,
105114 constFunction : aPlusBConst ,
106115 anonymousFunction : function ( a : number , b : number ) {
Original file line number Diff line number Diff line change @@ -16,13 +16,14 @@ export const stringType = defineEasyType<string>({
1616 const value = showRest
1717 ? props . value
1818 : props . value . slice ( 0 , collapseStringsAfterLength )
19- const hasRest = props . value . length > collapseStringsAfterLength
19+ const hasRest = ( props . value . length > collapseStringsAfterLength ) || props . value . includes ( '\n' )
2020 return (
2121 < Box
2222 component = 'span'
2323 sx = { {
2424 overflowWrap : 'anywhere' ,
25- cursor : hasRest ? 'pointer' : 'inherit'
25+ cursor : hasRest ? 'pointer' : 'inherit' ,
26+ whiteSpace : showRest ? 'pre-wrap' : 'normal'
2627 } }
2728 onClick = { ( ) => {
2829 if ( window . getSelection ( ) ?. type === 'Range' ) {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export const DataBox: FC<DataBoxProps> = props => (
1111 { ...props }
1212 sx = { {
1313 display : 'inline-block' ,
14+ verticalAlign : 'top' ,
1415 ...props . sx
1516 } }
1617 />
You can’t perform that action at this time.
0 commit comments