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(Table): prevent @select event call when selecting all rows #838

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

mwohlan
Copy link
Contributor

@mwohlan mwohlan commented Oct 19, 2023

πŸ”— Linked issue

#646 #652

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Reverts some of the changes made in #652.

Currently when checking the table header checkbox while the onSelect listener is used, onSelect is executed for every
row instead of just pushing the values to the selected Ref. This is an issue when onSelect is used as suggested in the Docs:

You can use this to navigate to a page, open a modal or even to select the row manually.

In my use case the modal linked to the last item in the rows array will always open ( or many modals at once if implemented differently) and for navigation this is similar. There is no good way to prevent this as only the row is passed to onSelect. I think the checkbox state should not trigger onSelect. The other way around its fine imo and up to the user.

Edit: May be a breaking change to some existing implementations.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel
Copy link

vercel bot commented Oct 19, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
ui βœ… Ready (Inspect) Visit Preview Oct 19, 2023 2:41pm

@benjamincanac benjamincanac changed the title fix(Table): selectAllRows behaviour fix(Table): prevent onSelect call when selecting all rows Oct 20, 2023
@benjamincanac benjamincanac changed the title fix(Table): prevent onSelect call when selecting all rows fix(Table): prevent @select event call when selecting all rows Oct 20, 2023
@benjamincanac benjamincanac merged commit 51f4d54 into nuxt:dev Oct 20, 2023
2 checks passed
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

2 participants