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

disable "save" button when "isSaving" is true #1032

Merged
merged 1 commit into from Mar 6, 2024

Conversation

loughlinclaus3
Copy link
Contributor

This addition would allow for developers to prevent users from submitting the same edit/new row twice when the click the "save" button multiple times. It makes use rarely-used of the isSaving state of the table to disable the "save" button. Should be very useful for developers who make use of async CRUD data.

All developers would have to do is set the isSaving state to true at the start of the onEditingRowSave/onCreatingRowSave function, and once their async calls are finished, they set it back to false.

This PR was based off of the idea proposed in this discord message.

Copy link

vercel bot commented Mar 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
material-react-table ❌ Failed (Inspect) Mar 6, 2024 8:44pm
material-react-table-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2024 8:44pm

@KevinVandy KevinVandy merged commit ce98410 into KevinVandy:v2 Mar 6, 2024
2 of 4 checks passed
@loughlinclaus3 loughlinclaus3 deleted the disable-save-on-click branch March 6, 2024 21:08
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