Skip to content

Excessive rerenders with SolidJS and classList #1380

@mac501pl

Description

@mac501pl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions