Skip to content

Commit

Permalink
Fix not null value relation (#3446)
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored May 23, 2024
1 parent baf5c4c commit e952599
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/qml/form/editors/MMFormValueRelationEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,6 @@ MMFormComboboxBaseEditor {
valueRole: "FeatureId"
textRole: "FeatureTitle"

selected: {
if ( internal.allowMultivalue ) {
return vrModel.convertFromQgisType( root._fieldValue, MM.FeaturesModel.FeatureId )
}
else {
return [root._fieldValue]
}
}

list.model: MM.ValueRelationFeaturesModel {
id: vrDropdownModel

Expand Down Expand Up @@ -120,7 +111,16 @@ MMFormComboboxBaseEditor {
close()
}

Component.onCompleted: open()
Component.onCompleted: {
// We want to set the initial value of 'selected' property but not bind it so we avoid a binding loop
if ( internal.allowMultivalue ) {
selected = vrModel.convertFromQgisType( root._fieldValue, MM.FeaturesModel.FeatureId )
}
else {
selected = [root._fieldValue]
}
open()
}
}
}

Expand Down

1 comment on commit e952599

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 24.5.623011 just submitted!

Please sign in to comment.