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

Excessive rerenders with SolidJS and classList #1380

Open
mac501pl opened this issue Apr 5, 2025 · 1 comment
Open

Excessive rerenders with SolidJS and classList #1380

mac501pl opened this issue Apr 5, 2025 · 1 comment

Comments

@mac501pl
Copy link

mac501pl commented Apr 5, 2025

Describe the bug

Using Solid's classList inside a form.Field when name attribute and onBlur handler are present causes the field to be rerendered multiple times when blurred (10 times initially, 4 times each following blur)

Your minimal, reproducible example

https://stackblitz.com/edit/solidjs-templates-zqhzdfcv?file=src%2Findex.tsx

Steps to reproduce

  1. Open up the preview in a new tab and open the console
  2. Click inside and then click outside the input field
  3. "rerender" gets logged multiple times

Expected behavior

Rerender to happen at most once

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Tested on the latest Chrome/Windows 11

TanStack Form adapter

solid-form

TanStack Form version

v1.3.0

TypeScript version

v5.8.3

Additional context

Removing the name attribute fixes the issue

@mac501pl
Copy link
Author

mac501pl commented Apr 5, 2025

I just realized that under the Solid context the field isn't "rerendered" as I described, but the test function is still called more times than it should be :)

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