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(cdk:portal): remove targetHashMap #980

Merged
merged 1 commit into from
Jun 28, 2022
Merged

Conversation

brenner8023
Copy link
Member

FIXED: #949

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?

需要维护一份targetHashMap的缓存

What is the new behavior?

删除targetHashMap,不维护缓存

Other information

@idux-bot
Copy link

idux-bot bot commented Jun 26, 2022

This preview will be available after the AzureCI is passed.

@brenner8023 brenner8023 changed the title fix: remove targetHashMap fix(cdk:portal): remove targetHashMap Jun 26, 2022
@codecov
Copy link

codecov bot commented Jun 26, 2022

Codecov Report

Merging #980 (499845a) into main (ddd67e3) will increase coverage by 0.00%.
The diff coverage is 93.75%.

❗ Current head 499845a differs from pull request most recent head 75c24b5. Consider uploading reports for the commit 75c24b5 to get more accurate results

@@           Coverage Diff           @@
##             main     #980   +/-   ##
=======================================
  Coverage   92.66%   92.66%           
=======================================
  Files         706      706           
  Lines       69024    69025    +1     
  Branches     8044     8044           
=======================================
+ Hits        63961    63962    +1     
  Misses       5063     5063           
Impacted Files Coverage Δ
packages/components/modal/src/ModalWrapper.tsx 80.95% <0.00%> (ø)
packages/cdk/portal/src/convertTarget.ts 100.00% <100.00%> (ø)
...components/carousel/src/composables/useAutoplay.ts 100.00% <100.00%> (ø)
...es/components/tree/src/composables/useCheckable.ts 100.00% <100.00%> (ø)
packages/components/tree/src/utils/index.ts 86.30% <100.00%> (+0.38%) ⬆️

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 ddd67e3...75c24b5. Read the comment docs.

@danranVm
Copy link
Member

@brenner8023 test 挂掉了

const targetHashmap: Record<string, HTMLElement> = {}
function tryFindElement(selector: string) {
const classSelector = `.${selector}`
return document.querySelector<HTMLElement>(selector) ?? document.querySelector<HTMLElement>(classSelector)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return document.querySelector<HTMLElement>(selector) ?? document.querySelector<HTMLElement>(classSelector)
return document.querySelector<HTMLElement>(selector) ?? document.querySelector<HTMLElement>(`.${selector}`)

@danranVm danranVm merged commit 5f1e637 into IDuxFE:main Jun 28, 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
Development

Successfully merging this pull request may close these issues.

[cdk:portal] 微前端场景下可能会有问题,出现弹窗打不开
2 participants