Skip to content

Fix tree shift multiple #2648

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

Closed
wants to merge 2 commits into from
Closed

Fix tree shift multiple #2648

wants to merge 2 commits into from

Conversation

labike
Copy link

@labike labike commented Aug 6, 2020

First of all, thank you for your contribution! 😄

New feature please send pull request to feature branch, and rest to master branch. Pull request will be merged after one of collaborators approve. Please makes sure that these form are filled before submitting your pull request, thank you!

[中文版模板 / Chinese template]

This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

What's the background?

  1. Describe the source of requirement.
    shift不能多选
  1. Resolve what problem.
    修复组件shift多选功能, 其问题出现在DirectoryTree onSelect方法中, 当使用shift选中时this.cacheSelectedKeys为undefined, 最终newSelectedKeys为空数组. 我们需要在event为shift并且multiple的时候也缓存shift选中的值
if () {
...
}else if (multiple && shiftPick) {
        // Shift click
        this.cachedSelectedKeys = keys;
        newSelectedKeys = Array.from(
          new Set([
            ...(this.cachedSelectedKeys || []),
            ...calcRangeKeys(children, expandedKeys, eventKey, this.lastSelectedKey),
          ]),
        );
        newEvent.selectedNodes = convertDirectoryKeysToNodes(children, newSelectedKeys);
      }

tree-shift-multiple

  1. Related issue link.
    使用treeData属性的directory-tree无法正确使用shift全选 #1744

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)

  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?

Changelog description (Optional if not new feature)

  1. English description
    <a-directory-tree /> shift not multiple
  1. Chinese description (optional)
    <a-directory-tree> shift多选

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 is provided or not needed

Additional Plan? (Optional if not new feature)

If this PR related with other PR or following info. You can type here.

@labike labike closed this Aug 6, 2020
@labike
Copy link
Author

labike commented Aug 6, 2020

submit info error

@github-actions
Copy link

github-actions bot commented Aug 7, 2021

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants