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

feat(cdk:utils): add zIndex manager #1015

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

brenner8023
Copy link
Member

@brenner8023 brenner8023 commented Jul 13, 2022

FIXED: #998

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

What is the current behavior?

弹窗重叠时没有把zIndex加一

image

What is the new behavior?

modal会自动计算z-index, 后出现的弹窗会在前一个弹窗的基础上 z-index + 1

image

image

Other information

@idux-bot
Copy link

idux-bot bot commented Jul 13, 2022

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #1015 (00076ad) into main (32e48d8) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1015      +/-   ##
==========================================
+ Coverage   93.73%   93.75%   +0.01%     
==========================================
  Files         313      314       +1     
  Lines       29922    29987      +65     
  Branches     3537     3540       +3     
==========================================
+ Hits        28048    28113      +65     
  Misses       1874     1874              
Impacted Files Coverage Δ
packages/cdk/utils/src/zIndex.ts 100.00% <100.00%> (ø)
...ckages/components/_private/overlay/src/Overlay.tsx 97.17% <100.00%> (+0.11%) ⬆️
packages/components/config/src/defaultConfig.ts 100.00% <100.00%> (ø)
packages/components/config/src/types.ts 100.00% <100.00%> (ø)
packages/components/drawer/src/Drawer.tsx 94.91% <100.00%> (+0.02%) ⬆️
packages/components/drawer/src/DrawerWrapper.tsx 83.84% <100.00%> (ø)
packages/components/drawer/src/token.ts 100.00% <100.00%> (ø)
packages/components/modal/src/Modal.tsx 99.40% <100.00%> (+0.04%) ⬆️
packages/components/modal/src/ModalWrapper.tsx 81.00% <100.00%> (ø)
packages/components/modal/src/token.ts 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 32e48d8...00076ad. Read the comment docs.

@brenner8023 brenner8023 force-pushed the feat/add-zIndex branch 5 times, most recently from 0f9c7c2 to 7cf1f1d Compare July 20, 2022 09:21
@brenner8023 brenner8023 changed the title feat(cdk:*): add zIndexManager feat(cdk:utils): add zIndex manager Jul 23, 2022
@brenner8023 brenner8023 force-pushed the feat/add-zIndex branch 2 times, most recently from fc6807c to bfd4d85 Compare July 24, 2022 02:23
Copy link
Member

@danranVm danranVm left a comment

Choose a reason for hiding this comment

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

销毁后,zIndex 不重置了?

@brenner8023
Copy link
Member Author

销毁后,zIndex 不重置了?

重置zIndex需要维护一份element的缓存,维护缓存会增加代码的负担。zIndex累加,从1000加到9999需要页面交互操作8999次,容错的数据足够大,理论上不会出现什么超过9999、超过zIndex最大值的问题。

@danranVm danranVm merged commit 03e6aa5 into IDuxFE:main Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants