keystonejs/keystone-classic

[4.0] Bad Select Options for relationships depending on other relationships

Ouverte

#3 598 ouverte le 13 oct. 2016

 (3 commentaires) (1 réaction) (0 personne assignée)JavaScript (2 288 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (14 656 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Steps to reproduce the behavior

Have a Model with the following fields, the idea being that 'two''s choices depend on what you selected in 'one'

one: { type: Types.Relationship, ref:"SomeModel", required:true, initial:true } two: { type: Types.Relationship, ref:"SomeOtherModel", required:true, initial:true, filters: { from: ':one' }},

Now in the admin ui if you choose a value for 'one', then go to the dropdown for 'two', the options in the dropdown lag behind what they should be, and to get the correct options you have to select a value, then unselect it, then try the dropdown again.

Expected behavior

you get values in the dropdown for 'two' of SomeOtherModel rows that have the 'from' field matching 'one'

Actual behavior

you get values in the dropdown for 'two' of SomeOtherModel rows that have the 'from' field matching what 'one' was previously

Guide contributeur