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: prevent the editor from initializing when switching tabs #698

Merged
merged 1 commit into from
Mar 8, 2022

Conversation

kiwiwong
Copy link
Collaborator

@kiwiwong kiwiwong commented Mar 8, 2022

简介

修复切换editor tab时editor总是会初始化的问题。

Fixes #663

变更

  • 去掉传给MonacoEditor的key属性(因为切换tab时会导致key变化,从而导致初始化)

@kiwiwong kiwiwong added the bug Something isn't working label Mar 8, 2022
@kiwiwong kiwiwong requested review from wewoor and mortalYoung March 8, 2022 09:40
@kiwiwong kiwiwong self-assigned this Mar 8, 2022
@kiwiwong kiwiwong changed the title fix: make editor not initialize when switching tabs fix: prevent the editor from initializing when switching tabs Mar 8, 2022
@codecov
Copy link

codecov bot commented Mar 8, 2022

Codecov Report

Merging #698 (1748856) into main (1d4f6da) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #698   +/-   ##
=======================================
  Coverage   91.33%   91.33%           
=======================================
  Files         189      189           
  Lines        5942     5942           
  Branches     1426     1426           
=======================================
  Hits         5427     5427           
  Misses        508      508           
  Partials        7        7           
Impacted Files Coverage Δ
src/workbench/editor/group.tsx 86.48% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d4f6da...1748856. Read the comment docs.

Copy link
Collaborator

@wewoor wewoor left a comment

Choose a reason for hiding this comment

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

有没有测试不同的 Group, Tab 切换下的编辑情况啊

@kiwiwong
Copy link
Collaborator Author

kiwiwong commented Mar 8, 2022

有没有测试不同的 Group, Tab 切换下的编辑情况啊

测试过,在不同Group、Tab下编辑以及关闭tab都是正常的

@wewoor wewoor merged commit 814c5b2 into main Mar 8, 2022
@wewoor wewoor deleted the fix/switchEditor branch March 8, 2022 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: updates are triggered multiple times when a file is edited in the Editor
2 participants