Skip to content

Commit

Permalink
#4159: Increase textfields maxlength - better place for injecting max…
Browse files Browse the repository at this point in the history
…length
  • Loading branch information
stefan-korn authored and dafeder committed Jul 2, 2024
1 parent aaf3ed1 commit b810750
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions modules/json_form_widget/src/SchemaUiHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ public function updateWidgets(mixed $spec, array $element) {
return $this->widgetRouter->getConfiguredWidget($spec, $element);
}
else {
if ($element['#type'] === 'textfield' && empty($element['#maxlength'])) {
$element['#maxlength'] = 256;
}
return $element;
}
}
Expand Down
3 changes: 0 additions & 3 deletions modules/json_form_widget/src/WidgetRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ public function getConfiguredWidget(mixed $spec, array $element) {
$method_name = $widgets[$spec->widget];
$element = $this->$method_name($spec, $element);
}
if ($element['#type'] === 'textfield' && empty($element['#maxlength'])) {
$element['#maxlength'] = 256;
}
return $element;
}

Expand Down

0 comments on commit b810750

Please sign in to comment.