Skip to content
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

Fix handling of code editor refresh #7672

Merged
merged 2 commits into from Dec 23, 2019

Conversation

blink1073
Copy link
Member

@blink1073 blink1073 commented Dec 20, 2019

References

Fixes #7671

Code changes

Handles the case where a code editor is not visible when it tries to update. This can happen when the widget is attached and visible, and then is no longer visible when onUpdateRequest is later called.

User-facing changes

None in core JupyterLab, affects extension authors using code editors and things that depend on them (like notebooks).

Backwards-incompatible changes

None.

@blink1073 blink1073 added this to the 2.0 milestone Dec 20, 2019
@jupyterlab-dev-mode
Copy link

@jupyterlab-dev-mode jupyterlab-dev-mode bot commented Dec 20, 2019

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@@ -141,7 +141,7 @@ export class CodeEditorWrapper extends Widget {
* A message handler invoked on an `'after-show'` message.
*/
protected onAfterShow(msg: Message): void {
if (this._updateOnShow) {
if (this._updateOnShow || !this._hasRefreshed) {
Copy link
Contributor

@jasongrout jasongrout Dec 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this should be &&, not ||? Also, should _hasRefreshed be reset to false on hide?

Copy link
Member Author

@blink1073 blink1073 Dec 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the variable name and added a comment, as well as a reset whenever we attach.

Copy link
Contributor

@jasongrout jasongrout Dec 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. That name change and comment made the logic clearer. I'll test.

afshin
afshin approved these changes Dec 23, 2019
Copy link
Member

@afshin afshin left a comment

Thanks!
👍

@blink1073 blink1073 merged commit 3c6521e into jupyterlab:master Dec 23, 2019
8 of 10 checks passed
@lock lock bot added the status:resolved-locked label Jan 24, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
@blink1073 blink1073 deleted the fix-input-area-display branch Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg:codeeditor status:resolved-locked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants