Skip to content

Commit 1b2a224

Browse files
committed
HKI-766-71354 setting element readonly by default
1 parent f5e0e66 commit 1b2a224

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/os2forms_nemid/src/Plugin/WebformElement/NemidElementBase.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public function getDefaultProperties() {
3131
'minlength' => '',
3232
'maxlength' => '',
3333
'placeholder' => '',
34+
'readonly' => '',
3435
];
3536

3637
return $properties;
@@ -110,9 +111,9 @@ public function form(array $form, FormStateInterface $form_state) {
110111

111112
// @see \Drupal\webform\Plugin\WebformElement\WebformEntityReferenceTrait::form
112113
$element_properties = $form_state->get('element_properties');
113-
// If element is new, set disabled by default.
114+
// If element is new, set readonly by default.
114115
if (empty($element_properties['title'])) {
115-
$form['form']['disabled']['#value'] = TRUE;
116+
$form['form']['readonly']['#value'] = TRUE;
116117
}
117118

118119
// Here you can define and alter a webform element's properties UI.

0 commit comments

Comments
 (0)