next-admin icon indicating copy to clipboard operation
next-admin copied to clipboard

[BUG] - Can't update enum dropdown prisma field in edit and create forms

Open eng-ahmad-sameer opened this issue 9 months ago • 7 comments

Description

I upgraded my nextjs to 15 and my react to 19, after doing this the enum field dropdown is not updated in the edit and create form.

I noticed that the issue happens with enum fields that have a default value like the below:

approvalStatus                    ApprovalStatus       @default(Pending)

https://github.com/user-attachments/assets/66aae175-ed2a-4174-b6ad-1a829b10306f

Reproduction URL

N/A

Reproduction steps

N/A

Next router

App router

Next Admin version

7.3.0

Screenshots

![DESCRIPTION](LINK.png)

Next Admin options


Logs


Browsers

Chrome

eng-ahmad-sameer avatar Mar 20 '25 04:03 eng-ahmad-sameer

Hey @eng-ahmad-sameer

It seems that this issue comes from the form initialization made by @rjsf that we use to handle the json schema and turn it into form. We are working on a new major release that will get rid of this library, but there is still a long way to go

cregourd avatar Apr 04 '25 16:04 cregourd

@cregourd That's great news! Is there a timeline for this release, or any intermediary patch you reccomend?

the-inconvenience-store avatar Apr 08 '25 05:04 the-inconvenience-store

Hey @eng-ahmad-sameer, I'm struggling to reproduce this issue on current version of next-admin. I faced the issue during get rid of @rjsf work, but not in the current form of the lib. Do you still have the issue ?

cregourd avatar Apr 15 '25 09:04 cregourd

@cregourd That's great news! Is there a timeline for this release, or any intermediary patch you reccomend?

There is no schedule about these major changes, as I said, there is still a long way to go 🙂

cregourd avatar Apr 15 '25 09:04 cregourd

Hey @eng-ahmad-sameer, I'm struggling to reproduce this issue on current version of next-admin. I faced the issue during get rid of @rjsf work, but not in the current form of the lib. Do you still have the issue ?

@cregourd Yes, still facing it, below are the versions I am using:

"@premieroctet/next-admin": "^7.5.0",
"@premieroctet/next-admin-generator-prisma": "^0.0.7",
"next": "^15.2.4",
"prisma": "^6.5.0",
"@prisma/client": "^6.5.0",

eng-ahmad-sameer avatar Apr 21 '25 17:04 eng-ahmad-sameer

Same thing

denis23x avatar Apr 30 '25 07:04 denis23x

I'm going to have a look at it, thanks for your reports

foyarash avatar Apr 30 '25 08:04 foyarash

I'm facing it too

kaluxxx avatar May 19 '25 15:05 kaluxxx

I'm currently working on this bug FYI, this is related to some behavior with RJSF so it is quite tricky to debug

foyarash avatar May 19 '25 15:05 foyarash

Hello everyone,

Please see #599 which includes a patch file that you can use to patch the @rjsf/utils library. This is a short term solution until we migrate away from the RJSF lib.

foyarash avatar May 19 '25 15:05 foyarash

Hello everyone,

This should now be fixed in 8.2.1, which uses a new version of RJSF. The patch solution mentioned above is therefore not required anymore.

foyarash avatar Jun 12 '25 13:06 foyarash