Skip to content

Commit ddfde99

Browse files
committed
feat: display linewraps for multi-line strings
1 parent 2ecef6d commit ddfde99

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

docs/pages/full/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ map.set({}, 'world')
6969
const set = new Set([1, 2, 3])
7070

7171
const superLongString = '1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'
72+
const multiLineString = `Lorem ipsum dolor sit amet,
73+
consectetur adipiscing elit.
74+
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
75+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.`
7276

7377
const example = {
7478
avatar,
@@ -101,6 +105,7 @@ const example = {
101105
[3, 4]
102106
],
103107
superLongString,
108+
multiLineString,
104109
function: aPlusB,
105110
constFunction: aPlusBConst,
106111
anonymousFunction: function (a: number, b: number) {

src/components/DataTypes/String.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export const stringType = defineEasyType<string>({
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') {

src/components/mui/DataBox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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
/>

0 commit comments

Comments
 (0)