keystonejs/keystone-classic

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

Open

#3598 opened on Oct 13, 2016

View on GitHub
 (3 comments) (1 reaction) (0 assignees)JavaScript (14,656 stars) (2,288 forks)batch import
bughelp wanted

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

Contributor guide