Skip to content

Custom slots (re-rendering) is re-fetching every options request #62

Closed
@jlsjonas

Description

@jlsjonas

This is (likely) an upstream bug & feature request. (related to this Vue issue)

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you check the documentation?
  • Did you perform a cursory search?

Description

When changing any data in a slot this causes a re-render of the parent (<enso-form>), this is due to Vue behaviour which is fixed only for statically defined slots at this point (see issue above).

The main issue this causes is that all SelectField's are re-fetching their data.

Steps to Reproduce

  1. Have a custom slot that contains changable data (f.e. a sum sourced by the defined select)
  2. Note that changing the value causes all forms to fetch data from the server again

Expected behavior

Updating a simple string not to refetch options of all fields in the form

Actual behavior

All select fields fetch data again, even if no parameters are changes

Suggestion

As this is most likely caused by Vue.js (2.0) behaviour, change the way SelectField fetches data (bubble up?) when used inside an EnsoForm (use the EnsoForm instance as a cache?)
To keep separation, preserve current behaviour if the caching property is unavailable.

I hope there's a better way as I fully understand this can't be ideal, but the limitations caused by the dynamically generated slots regenerating the whole form heavily limits the flexibility, especially when dealing with complex forms.

Metadata

Metadata

Assignees

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