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: improve close group in editor #267

Merged
merged 1 commit into from
Jul 22, 2021
Merged

fix: improve close group in editor #267

merged 1 commit into from
Jul 22, 2021

Conversation

mortalYoung
Copy link
Collaborator

@mortalYoung mortalYoung commented Jul 22, 2021

简介

  • 修复 editor 标签组关闭时,会导致 editor 消失的问题
  • 优化 editor 实例销毁 model 实例的逻辑
  • 修复当 editor 标签组位于第一个的时候,关闭标签组不会自动切换到下一个标签组的问题

主要变更

  • 导致 editor 消失的问题,经过定位发现是 key 的问题。当关闭标签组内最后一个标签会导致标签组关闭,会触发 MonacoEditor 组件的重渲染,但是由于没有设置 key 的问题,导致重渲染有问题
  • 之前销毁 model 的逻辑有问题,没有去判断要销毁的 model 所对应的 tab 在其他标签组存在打开的情况

Related Issues

Closed #266 Closed #265

@mumiao mumiao merged commit 26bd958 into main Jul 22, 2021
@mumiao mumiao deleted the fix/editor branch July 22, 2021 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants