Skip to content

Commit f704c61

Browse files
committed
fix(expanded): re-draw when expanded
1 parent df814ca commit f704c61

File tree

1 file changed

+8
-2
lines changed
  • src/notebook/components/cell/display-area

1 file changed

+8
-2
lines changed

src/notebook/components/cell/display-area/display.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default class Display extends React.Component {
2525
transforms,
2626
displayOrder,
2727
isHidden: false,
28-
expanded: true,
28+
expanded: false,
2929
};
3030

3131
constructor() {
@@ -51,6 +51,12 @@ export default class Display extends React.Component {
5151
return true;
5252
}
5353

54+
// Since expanded is a boolean, we need to make sure it's a property directly.
55+
if ({}.hasOwnProperty.call(nextProps, 'expanded') &&
56+
nextProps.expanded !== this.props.expanded) {
57+
return true;
58+
}
59+
5460
return false;
5561
}
5662

@@ -59,7 +65,7 @@ export default class Display extends React.Component {
5965
}
6066

6167
recomputeStyle() {
62-
if (this.el.scrollHeight > DEFAULT_SCROLL_HEIGHT) {
68+
if (!this.props.expanded && this.el.scrollHeight > DEFAULT_SCROLL_HEIGHT) {
6369
this.el.style.height = `${DEFAULT_SCROLL_HEIGHT}px`;
6470
this.el.style.overflowY = 'scroll';
6571
return;

0 commit comments

Comments
 (0)