Skip to content

Commit 49e1aec

Browse files
madsrasmussenNikolaj Geisle
authored andcommitted
add modelValue validation for server to correctly update validation errors
1 parent ca9dc94 commit 49e1aec

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker3/umb-media-picker3-property-editor.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,8 @@
6969
<span class="help-inline" ng-message="valServer" ng-bind-html="vm.propertyForm.maxCount.errorMsg"></span>
7070
</div>
7171

72+
<ng-form name="vm.modelValueForm">
73+
<input type="hidden" name="modelValue" ng-model="vm.model.value.length" ng-required="vm.model.validation.mandatory && vm.model.value.length === 0" />
74+
</ng-form>
75+
7276
</div>

src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker3/umbMediaPicker3PropertyEditor.component.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@
137137
if (vm.propertyForm) {
138138
vm.propertyForm.$setDirty();
139139
}
140+
141+
if (vm.modelValueForm) {
142+
vm.modelValueForm.modelValue.$setDirty();
143+
}
140144
}
141145

142146
function addMediaAt(createIndex, $event) {

0 commit comments

Comments
 (0)