Skip to content

Commit 6b7e494

Browse files
authored
fix: select field doesn't show the right values in some cases (#138)
1 parent 57ffd9d commit 6b7e494

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/frontend/js/components/Edit/SelectField.vue

+7-3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ export default {
3737
},
3838
methods: {
3939
setInitialValue() {
40-
if (this.field.display_value) {
41-
this.value = this.field.value
40+
if (this.field.enum) {
41+
if (this.field.display_value) {
42+
this.value = this.field.value
43+
} else {
44+
this.value = this.field.enum[this.field.value]
45+
}
4246
} else {
43-
this.value = this.field.enum[this.field.value]
47+
this.value = this.field.value
4448
}
4549
},
4650
optionLabel(label, value) {

spec/dummy/config/routes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Rails.application.routes.draw do
2-
root 'home#index'
2+
root to: redirect('/avo')
33
devise_for :users
44
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
55

0 commit comments

Comments
 (0)