Save button not changing to active when form fields are updated

System Information
  • Strapi Version: v4.16.2
  • Node Version: v18.17.1
  • Yarn Version: 1.22.21

Hi all, I’m new to this and I’m facing an issue which I haven’t been able to solve just yet. My issue below;

I have a custom field connected with a custom plugin (handling specific validation purposes) which shows a file uploader, connected to cloudflare and the media library. Once image is uploaded, it will return the image id which would be assigned as a value to my custom field via JS. However, changing the value with JS, doesn’t seem to trigger a change, so the Save button of Strapi would remain disabled.

I tried triggering a manual event with JS, but that won’t work either.

When I change another field value from the same form, the save button becomes active, however upon saving, the value of the custom field won’t update either.

Thanks.

This has been solved by triggering the onChange event inside the useEffect of the value instead.