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

Version 7.11.3 causing too many re-renders and inputs inside columns constantly lose focus #625

Closed
sidpagariya opened this issue Aug 1, 2024 · 3 comments

Comments

@sidpagariya
Copy link

sidpagariya commented Aug 1, 2024

Describe the bug
Up through v7.11.2 any state/data updates didn't cause controlled inputs to be re-rendered within table columns. An input returned via the render didn't lose focus upon changing input value (which would update some field in the data passed to the table). With the release of v7.11.3 this behavior is now broken and the table re-renders causing the input to lose focus even when a single character is typed as it modifies the original state/data passed into the table.

To Reproduce
Steps to reproduce the behavior:

  1. Install v7.11.2 of mantine-datatable.
  2. Return a controlled input field in a column's custom render function that modifies the originally passed data prop of the table
  3. Verify the controlled input field doesn't lose focus when its value is changed by typing into it
  4. Install v7.11.3 of mantine-datatable.
  5. See that the controlled input field loses focus when its value is changed by typing into it

Expected behavior
The table shouldn't do a complete re-render. The controlled input that's being currently changed, hence, shouldn't lose focus even when modifying the table's original data prop like it did pre-v7.11.3.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu 24.04
  • Browser: Chrome
  • Version: 127.0.6533.72

Additional context
Add any other context about the problem here.

@icflorescu
Copy link
Owner

I think I may have a quick fix for this.

icflorescu added a commit that referenced this issue Sep 4, 2024
@icflorescu
Copy link
Owner

This should be fixed in v7.12.3; let me know if it works for you, or feel free to reopen if it doesn't.

@aemaem
Copy link

aemaem commented Nov 28, 2024

@icflorescu I have a side question: Was it an accident that this new feature was released in a patch version?
If not, then we have to pin our versions explicitly because currently we only pinned major versions.

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

3 participants