react-jsonschema-form icon indicating copy to clipboard operation
react-jsonschema-form copied to clipboard

onAddClick creating and immediately removing array item

Open AshleyHolton opened this issue 2 years ago • 3 comments

Prerequisites

What theme are you using?

other

Version

5.x

Current Behavior

Hi,

Currently using custom templates and everything works fine, however when I attempt to add a new array element via onAddClick, I see the flash of the item being added and then being immediately removed.

Reordering and delete buttons work fine so the formData is being dealt with correctly. It's just onAddClick that's a problem.

It's also odd that onChange is called 6 times when the button is clicked.

Expected Behavior

A new item should be added to the array and onChange called once.

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

AshleyHolton avatar May 10 '23 20:05 AshleyHolton

Maybe related to #3367 but hard to say without being able to see the custom template code.

nickgros avatar May 12 '23 15:05 nickgros

@AshleyHolton Can you provide us with a reproducible example? Without that there is not really anyway to fix this otherwise

heath-freenome avatar May 12 '23 15:05 heath-freenome

This issue has been automatically marked as possibly close because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.

stale[bot] avatar Aug 11 '24 03:08 stale[bot]

This issue was closed because of lack of recent activity. Reopen if you still need assistance.

stale[bot] avatar Sep 11 '24 00:09 stale[bot]