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: Anchor not trigger getCurrentAnchor when scroll #43916

Merged
merged 2 commits into from Jul 31, 2023
Merged

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Jul 31, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

ref #43913

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Anchor not trigger getCurrentAnchor when scroll.
🇨🇳 Chinese 修复 Anchor 在滚动时无法触发 getCurrentAnchor 的问题。

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at 5c4a9ca

This pull request enhances the Anchor component and its documentation. It fixes a bug and adds a feature in the test cases, improves the code quality and readability of the component, and adjusts the iframe height for the examples in both English and Chinese.

🔍 Walkthrough

🤖 Generated by Copilot at 5c4a9ca

  • Correct the expected calls and arguments for the onChange prop in a test case for the anchor component (link)
  • Add a new test case to verify that the getCurrentAnchor prop is repeatedly called when scrolling the window or document (link)
  • Remove an unnecessary condition check for the getCurrentAnchor prop in the anchor component logic (link)
  • Add a comment to indicate a potential bug in the comparison of the active link reference and the current anchor in the anchor component logic (link)
  • Add a blank line for readability and consistency in the anchor component logic (link)
  • Increase the iframe height for an example of using a custom component token to render the anchor link content in the English and Chinese documentation (components/anchor/index.en-US.md and components/anchor/index.zh-CN.md) (link, link)

@stackblitz
Copy link

stackblitz bot commented Jul 31, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 31, 2023

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
./dist/antd.min.js 382.55 KB (-8 B 🔽)
./dist/antd-with-locales.min.js 442.11 KB (-7 B 🔽)

@argos-ci
Copy link

argos-ci bot commented Jul 31, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No change detected - Jul 31, 2023, 10:10 AM

@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (3f6defb) 100.00% compared to head (5c4a9ca) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #43916   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          657       657           
  Lines        11080     11078    -2     
  Branches      2997      2996    -1     
=========================================
- Hits         11080     11078    -2     
Files Changed Coverage Δ
components/anchor/Anchor.tsx 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zombieJ zombieJ merged commit 4eb6074 into master Jul 31, 2023
95 checks passed
@zombieJ zombieJ deleted the fix-anchor branch July 31, 2023 10:26
@vagusX vagusX mentioned this pull request Jul 31, 2023
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.

None yet

3 participants