Skip to content

Deselecting branch (or the entire tree) upon a backspace key down while being focused in a search input #152

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
ryk0v opened this issue Feb 4, 2019 · 0 comments

Comments

@ryk0v
Copy link

ryk0v commented Feb 4, 2019

Hey, I need to deselect the entire tree / branch by pressing the backspace button while being focused in a search input. The select is treeCheckable and follows the SHOW_PARENT checked strategy. Is there anything out of the box to achieve that ? Basically I need to override this behavior to completely deselect the non-leaf option (branch or tree) rather than removing the deepest leaf.

onSearchInputKeyDown = event => {
    const { searchValue, valueList } = this.state;

    const { keyCode } = event;

    if (KeyCode.BACKSPACE === keyCode && this.isMultiple() && !searchValue && valueList.length) {
      const lastValue = valueList[valueList.length - 1].value;
      this.onMultipleSelectorRemove(event, lastValue);
    }
  };
@ryk0v ryk0v changed the title Deselecting branch (or the entire tree) upon a backspace key down Deselecting branch (or the entire tree) upon a backspace key down while being focused in a search input Feb 4, 2019
@ryk0v ryk0v closed this as completed Feb 6, 2019
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

No branches or pull requests

1 participant