Skip to content

Commit d4f1383

Browse files
authored
fix: make student response persist break line on display (openedx#125)
* fix: make student response persist break line on display * chore: scroll bug when selecting text
1 parent 5efd146 commit d4f1383

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/containers/ResponseDisplay/ResponseDisplay.scss

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
.preview-display {
4444
padding: map-get($spacers, 3) 0;
4545
}
46+
47+
.response-display-text-content {
48+
white-space: pre-line;
49+
overflow: hidden;
50+
}
4651
}
4752

4853
@include media-breakpoint-down(sm) {

src/containers/ResponseDisplay/__snapshots__/index.test.jsx.snap

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ exports[`ResponseDisplay component snapshot file upload disable with valid respo
55
className="response-display"
66
>
77
<Card>
8-
<Card.Body>
8+
<Card.Body
9+
className="response-display-text-content"
10+
>
911
parsed html (sanitized (some text response here))
1012
</Card.Body>
1113
</Card>
@@ -62,7 +64,9 @@ exports[`ResponseDisplay component snapshot file upload enable with valid respon
6264
}
6365
/>
6466
<Card>
65-
<Card.Body>
67+
<Card.Body
68+
className="response-display-text-content"
69+
>
6670
parsed html (sanitized (some text response here))
6771
</Card.Body>
6872
</Card>

src/containers/ResponseDisplay/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class ResponseDisplay extends React.Component {
4848
/* eslint-disable react/no-array-index-key */
4949
this.textContents.map((textContent, index) => (
5050
<Card key={index}>
51-
<Card.Body>{textContent}</Card.Body>
51+
<Card.Body className="response-display-text-content">{textContent}</Card.Body>
5252
</Card>
5353
))
5454
}

0 commit comments

Comments
 (0)