idris-maps / svelte-parts

Svelte components
https://svelte-parts.surge.sh
49 stars 5 forks source link

Form: Hook for custom field #3

Closed raratiru closed 3 years ago

raratiru commented 3 years ago

I have a ForeignKey.svelte component which implements an autocomplete feature where an inline form facilitates the creation of a new related instance (if it does not exist).

It would be lovely to be able to include it in the json object which creates the initial form:

const fields = {}

raratiru commented 3 years ago

... or I could first perform the selection of the related object using the autocomplete field and as a second step, include the result in the fields json object to dynamically generate the main form with the Select field already containing a value.