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: fix panels didn't active the next one after closing automatically #653

Merged
merged 1 commit into from
Feb 13, 2022

Conversation

mortalYoung
Copy link
Collaborator

简介

  • 修复 panel 关闭后无法自动选择下一个 panel 的问题
  • 优化 onTabChange 事件

主要变更

  • 无法自动选择的原因是在点击 close 图标的时候,同时触发了 onCloseonTabChange 两个事件,两个事件都修改了 current 的值,按照冒泡的时间顺序,先触发 onClose 的 current 修改,然后是 onTabChange 的 current 修改,导致 bug。只需要取消 onClose 事件的冒泡即可

@codecov
Copy link

codecov bot commented Feb 13, 2022

Codecov Report

Merging #653 (64a7df8) into main (2294b3d) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #653   +/-   ##
=======================================
  Coverage   89.34%   89.34%           
=======================================
  Files         185      185           
  Lines        5613     5613           
  Branches     1332     1332           
=======================================
  Hits         5015     5015           
  Misses        590      590           
  Partials        8        8           
Impacted Files Coverage Δ
src/components/tabs/tabExtra.tsx 100.00% <ø> (ø)
src/components/tabs/tab.tsx 100.00% <100.00%> (ø)
src/controller/panel.tsx 100.00% <100.00%> (ø)

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 2294b3d...64a7df8. 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.

+1

@wewoor wewoor merged commit 784dc07 into main Feb 13, 2022
@wewoor wewoor deleted the fix/panel branch February 13, 2022 12:04
@wewoor wewoor added the bug Something isn't working label Feb 13, 2022
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.

2 participants