Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add example and default value to radio buttons #303

Merged
merged 2 commits into from
Apr 1, 2022
Merged

Add example and default value to radio buttons #303

merged 2 commits into from
Apr 1, 2022

Conversation

Quehnie
Copy link
Contributor

@Quehnie Quehnie commented Oct 22, 2021

Q A
Bug fix? yes
New feature? yes
License MIT

What's in this PR?

Content managers can add a default value and a placeholder for radiobuttons.

Why?

If nothing is set there is a "None" value shown as default.

Example Usage

Create a new form with radio buttons.

BC Breaks/Deprecations

Existing "None" selections will dissapear. EDIT: this is expected and can be avoided by the content manager when selecting Required on the radio buttons, or any other choice.

@alexander-schranz alexander-schranz changed the title Added example and default value to radio buttons Add example and default value to radio buttons Apr 1, 2022
@@ -39,6 +39,8 @@ private function getChoiceOptions(
FormFieldTranslation $translation,
array $options
): array {
$options['placeholder'] = false;
Copy link
Member

@alexander-schranz alexander-schranz Apr 1, 2022

Choose a reason for hiding this comment

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

if no empty value should be displayed the content manager need to set the value the required flag. Will remove this change.

@alexander-schranz alexander-schranz enabled auto-merge (squash) April 1, 2022 15:53
@alexander-schranz alexander-schranz merged commit 8c6f977 into sulu:2.4 Apr 1, 2022
@alexander-schranz
Copy link
Member

@Quehnie Thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants