diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a628b70c30..59eff5965a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,22 +1,42 @@ -First of all, thank you for your contribution! :-) +First of all, thank you for your contribution! 😄 -Please makes sure that these checkboxes are checked before submitting your pull request, thank you! +Please makes sure that these form are filled before submitting your pull request, thank you! -* [ ] Make sure that you propose pull request to right branch: bugfix for `master`, feature for branch `feature`. -* [ ] Make sure that you follow antd's [code convention](https://github.com/ant-design/ant-design/wiki/Code-convention-for-antd). -* [ ] Run `npm run lint` and fix those errors before submitting in order to keep consistent code style. -* [ ] Rebase before creating a pull request to keep commit history clear. -* [ ] Add some descriptions and refer relative issues for you pull request. +[[中文版](https://github.com/ant-design/ant-design/blob/master/.github/PULL_REQUEST_TEMPLATE/pr_cn.md)] -Extra checklist: +### This is a ... -**if** *isBugFix* **:** +- [ ] New feature +- [ ] Bug fix +- [ ] Site / document update +- [ ] Branch merge +- [ ] Other (about what?) - * [ ] Make sure that you add at least one unit test for the bug which you had fixed. +### What's the background? + +> 1. Describe the source of requirement. +> 2. Resolve what problem. +> 3. Related issue link. + +### API Realization (Optional if not new feature) + +> 1. Basic thought of solution and other optional proposal. +> 2. List final API realization and usage sample. +> 3. GIF or snapshot should be provided if includes UI/interactive modification. + +### What's the effect? (Optional if not new feature) -**elif** *isNewFeature* **:** +> 1. Does this PR affect user? Which part will be affected? +> 2. What will say in changelog? +> 3. Does this PR contains potential break change or other risk? - * [ ] Update API docs for the component. - * [ ] Update/Add demo to demonstrate new feature. - * [ ] Update TypeScript definition for the component. - * [ ] Add unit tests for the feature. +### Self Check before Merge + +- [ ] Doc is updated/provided or not needed +- [ ] Demo is updated/provided or not needed +- [ ] TypeScript definition is updated/provided or not needed +- [ ] Changelog provided + +### Additional Plan? (Optional if not new feature) + +> If this PR related with other PR or following info. You can type here. diff --git a/.github/PULL_REQUEST_TEMPLATE/collaborator.md b/.github/PULL_REQUEST_TEMPLATE/collaborator.md deleted file mode 100644 index 258332b2bb..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE/collaborator.md +++ /dev/null @@ -1,33 +0,0 @@ -### This is a ... - -- [ ] New feature -- [ ] Other - -### What's the background? - -> 1. Describe the source of requirement. -> 2. Resolve what problem. -> 3. Related issue link. - -### API Realization - -> 1. Basic thought of solution and other optional proposal. -> 2. List final API realization and usage sample. -> 3. GIF or snapshot should be provided if includes UI/interactive modification. - -### What's the affect? - -> 1. Does this PR affect user? Which part will be affected? -> 2. What will say in changelog? -> 3. Does this PR contains potential break change or other risk? - -### Self Check before Merge - -- [ ] Doc is ready or not need -- [ ] Demo is provided or not need -- [ ] TypeScript definition is ready or not need -- [ ] Changelog provided - -### Additional Plan? - -> If this PR related with other PR or following info. You can type here. diff --git a/.github/PULL_REQUEST_TEMPLATE/pr_cn.md b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md new file mode 100644 index 0000000000..949d22d389 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md @@ -0,0 +1,42 @@ +首先,感谢你的贡献!😄 + +请确保填写以下 pull request 的信息,谢谢!~ + +[[English Version](?expand=1)] + +### 这个变动的性质是 + +- [ ] 新特性提交 +- [ ] 日常 bug 修复 +- [ ] 站点、文档改进 +- [ ] 分支合 +- [ ] 其他改动(是关于什么的改动?) + +### 需求背景 + +> 1. 描述相关需求的来源。 +> 2. 要解决的问题。 +> 3. 相关的 issue 讨论链接。 + +### 实现方案和 API + +> 1. 基本的解决思路和其他可选方案。 +> 2. 列出最终的 API 实现和用法。 +> 3. 涉及UI/交互变动需要有截图或 GIF。 + +### 对用户的影响和可能的风险 + +> 1. 这个改动对用户端是否有影响?影响的方面有哪些? +> 2. 预期的 changelog 要怎么写? +> 3. 是否有可能隐含的 break change 和其他风险? + +### 请求合并前的自查清单 + +- [ ] 文档已补充或无须补充 +- [ ] 代码演示已提供或无须提供 +- [ ] TypeScript 定义已补充或无须补充 +- [ ] Changelog 已提供或无须提供 + +### 后续计划 + +> 如果这个提交后面还有相关的其他提交和跟进信息,可以写在这里。 diff --git a/components/_util/raf.ts b/components/_util/raf.ts index 7d3e12dc8b..a0138e4239 100644 --- a/components/_util/raf.ts +++ b/components/_util/raf.ts @@ -28,7 +28,7 @@ export default function wrapperRaf(callback: () => void, delayFrames: number = 1 return myId; } -wrapperRaf.cancel = function(id: number) { - raf.cancel(ids[id]); - delete ids[id]; +wrapperRaf.cancel = function(pid: number) { + raf.cancel(ids[pid]); + delete ids[pid]; }; diff --git a/components/affix/index.tsx b/components/affix/index.tsx index c7e96f742d..7770ba71b8 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -98,6 +98,7 @@ export default class Affix extends React.Component { if (shallowequal(affixStyle, originalAffixStyle)) { return; } + this.setState({ affixStyle: affixStyle as React.CSSProperties }, () => { const affixed = !!this.state.affixStyle; if ((affixStyle && !originalAffixStyle) || (!affixStyle && originalAffixStyle)) { @@ -163,7 +164,8 @@ export default class Affix extends React.Component { const targetRect = getTargetRect(targetNode); const targetInnerHeight = (targetNode as Window).innerHeight || (targetNode as HTMLElement).clientHeight; - if (scrollTop > elemOffset.top - (offsetTop as number) && offsetMode.top) { + // ref: https://github.com/ant-design/ant-design/issues/13662 + if (scrollTop >= elemOffset.top - (offsetTop as number) && offsetMode.top) { // Fixed Top const width = elemOffset.width; const top = targetRect.top + (offsetTop as number); @@ -178,7 +180,8 @@ export default class Affix extends React.Component { height: elemSize.height, }); } else if ( - scrollTop < elemOffset.top + elemSize.height + (offsetBottom as number) - targetInnerHeight && + scrollTop <= + elemOffset.top + elemSize.height + (offsetBottom as number) - targetInnerHeight && offsetMode.bottom ) { // Fixed Bottom diff --git a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap index 629b751ab9..ac7b6978fd 100644 --- a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap +++ b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap @@ -7,7 +7,7 @@ exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = ` >