diff --git a/src/Drupal/Commands/field/FieldCreateCommands.php b/src/Drupal/Commands/field/FieldCreateCommands.php index 412100a894..f892f0115d 100644 --- a/src/Drupal/Commands/field/FieldCreateCommands.php +++ b/src/Drupal/Commands/field/FieldCreateCommands.php @@ -315,7 +315,9 @@ protected function askFieldWidget(): string $choices[$name] = $label; } - return $this->io()->choice('Field widget', $choices, key($choices)); + $default = $this->input->getOption('show-machine-names') ? key($choices) : current($choices); + + return $this->io()->choice('Field widget', $choices, $default); } protected function askRequired(): bool