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

[Component] [table] Issue happens when listening the select-all event #16796

Closed
lhyUnited opened this issue May 9, 2024 · 4 comments · Fixed by #16800
Closed

[Component] [table] Issue happens when listening the select-all event #16796

lhyUnited opened this issue May 9, 2024 · 4 comments · Fixed by #16800

Comments

@lhyUnited
Copy link

Bug Type: Component

Environment

  • Vue Version: 3.5.0-alpha.2
  • Element Plus Version: 2.7.2
  • Browser / OS: 124.0.6367.119 (Official Build) (x86_64)
  • Build Tool: Other

Reproduction

Related Component

  • el-table

Reproduction Link

Element Plus Playground

Steps to reproduce

Steps:

  1. Create a Table with two or more types of data and a Select to change different types of data to show.
  2. First select some items on the Food
  3. Switch to Drink types of data
  4. Select all and unselect all
  5. Switch back to Food, do nothing
  6. Switch to Drink again and check the result

What is Expected?

The select-all header-cell should be unchecked since there is no item being selected.

What is actually happening?

The select-all header-cell is selected.

Additional comments

(empty)

@Liao-js
Copy link
Contributor

Liao-js commented May 9, 2024

you can see this demo,does it meet your expectations?

@lhyUnited
Copy link
Author

Yes, it works well. But the root cause is here, table gives selection out which would cause object reference issue. The data of listeners could change unexpectedly

instance.emit('select-all', selection.value)

@Liao-js
Copy link
Contributor

Liao-js commented May 9, 2024

About PR #16800

@Liao-js
Copy link
Contributor

Liao-js commented May 9, 2024

because when selecting all and canceling, the selection is not updated again. When switching to Food, Food and Drink have the same reference.

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 a pull request may close this issue.

2 participants