-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix cells being erased when saving and then changing focus to another… #8482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is high priority, so I'll be porting this over to the release branch too. |
const newVMs = [...this.pendingState.cellVMs]; | ||
for (let i = 0; i < newVMs.length; i += 1) { | ||
const text = this.getMonacoEditorContents(newVMs[i].cell.id); | ||
if (text) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this bit work if you delete the text to empty out the string? If I'm reading it right you could delete the text, the '' would be falsy and not saved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think you're right. I should check for undefined, not falsy
In reply to: 344416085 [](ancestors = 344416085)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
Codecov Report
@@ Coverage Diff @@
## master #8482 +/- ##
=========================================
- Coverage 59.39% 59.09% -0.3%
=========================================
Files 509 510 +1
Lines 23422 23561 +139
Branches 3786 3813 +27
=========================================
+ Hits 13912 13924 +12
- Misses 8604 8729 +125
- Partials 906 908 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#8482) * Fix cells being erased when saving and then changing focus to another cell * Make sure to use the source even if it's empty
… cell
For #8399
Root cause here is we were updating the state in line instead of calling setState.
Redux refactor would have fixed this as well.