Answers.Body: <p>The difference is in the definition. The color field has the <em>Options Per Line</em> set. This has as a side-effect that it disables the clear box (and the change options wrench). Clearing this field makes the clear option return.  <a href="https://i.sstatic.net/k8Kug.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/k8Kug.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-15T10:04:59.657Z
Answers.Text: Good to know, but sounds like a bug.  Being able to clear options should not depend on the layout.  I'd suggest logging that as an issue on lab.civicrm.org
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-15T12:45:00.003Z
Answers.Text: @Aidan, you right, it is a bug. I will make an issue. I post it here because for some users this workaround will be fine.
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-15T13:04:18.057Z
Answers.Text: I created the issue https://lab.civicrm.org/dev/core/-/issues/1821
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-15T08:11:06.967Z
Answers.LastActivityDate: 2020-06-15T08:11:06.967Z
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.Body: <p>The answer posted by Kainuk sounds like a bug in civicrm. After it is fixed and still the "clear" option is not visible, make sure the custom field is not set to "Required".</p>
  
  <p>Required custom fields do not have the <code>clear</code> option displaying on the radio custom field.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-15T13:04:33.083Z
Answers.Text: I posted the bug here https://lab.civicrm.org/dev/core/-/issues/1821
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-15T12:33:46.493Z
Answers.LastActivityDate: 2020-06-15T12:33:46.493Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>When a custom field with radio options is created it has sometimes a clear option (see below).<a href="https://i.sstatic.net/KTeVZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KTeVZ.png" alt="enter image description here"></a>.</p>
  
  <p>And sometimes it's not available like the color field. The first thought is that the reason is that the color field is mandatory, so the clear option is not needed, but that's is not the case. It is also optional. The missing clear option is annoying because it's not possible to undo a wrong choice. The used CiviCRM version is 5.28.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-04-29T10:45:50.633Z
Comments.Text: Is there a fix for this bug ?
  On the issue, Kainuk gives some details but I don't find the code to add the possibility to clear radio choice. In TD, class "html-adjust" of templates/CRM/Custom/Form/Edit/CustomField.tpl file, I don't find how function addOptionsEditLink is called, I only see an "elseif" which include CRM/Custom/Form/ContactReference.tpl file. The function addOptionsEditLink is in CRM/Core/Form/Renderer.php file and probably need to change this condition on line 129 "if (in_array($element->getType(), $typesToShowEditLink) && $hasEditPath) {"
Comments.UserDisplayName: Alain Rihs
Tags: <custom-fields>
Title: Why is the clear option missing on a custom field with radio options?
ThreadText: # Why is the clear option missing on a custom field with radio options?
  
  (Asked by: username_0 on 2020-06-15)
  
  When a custom field with radio options is created it has sometimes a clear option (see below).[![enter image description here](https://i.sstatic.net/KTeVZ.png)](https://i.sstatic.net/KTeVZ.png).
  
  And sometimes it's not available like the color field. The first thought is that the reason is that the color field is mandatory, so the clear option is not needed, but that's is not the case. It is also optional. The missing clear option is annoying because it's not possible to undo a wrong choice. The used CiviCRM version is 5.28.
  
  **Tags:** custom-fields
  
  > **Comments:**
  > **username_1**: Is there a fix for this bug ? On the issue, Kainuk gives some details but I don't find the code to add the possibility to clear radio choice. In TD, class "html-adjust" of templates/CRM/Custom/Form/Edit/CustomField.tpl file, I don't find how function addOptionsEditLink is called, I only see an "elseif" which include CRM/Custom/Form/ContactReference.tpl file. The function addOptionsEditLink is in CRM/Core/Form/Renderer.php file and probably need to change this condition on line 129 "if (in_array($element->getType(), $typesToShowEditLink) && $hasEditPath) {"  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2020-06-15. Score: 4
  
  The difference is in the definition. The color field has the *Options Per Line* set. This has as a side-effect that it disables the clear box (and the change options wrench). Clearing this field makes the clear option return. [![enter image description here](https://i.sstatic.net/k8Kug.png)](https://i.sstatic.net/k8Kug.png)
  
  > **Comments:**
  > **username_2**: Good to know, but sounds like a bug.  Being able to clear options should not depend on the layout.  I'd suggest logging that as an issue on lab.civicrm.org  
  > **username_0**: @username_2, you right, it is a bug. I will make an issue. I post it here because for some users this workaround will be fine.  
  > **username_0**: I created the issue https://lab.civicrm.org/dev/core/-/issues/1821  
  
  ---
  
  ### Answer by username_3 on 2020-06-15. Score: 0
  
  The answer posted by Kainuk sounds like a bug in civicrm. After it is fixed and still the "clear" option is not visible, make sure the custom field is not set to "Required".
  
  Required custom fields do not have the `clear` option displaying on the radio custom field.
  
  > **Comments:**
  > **username_0**: I posted the bug here https://lab.civicrm.org/dev/core/-/issues/1821  
  
  ---
  
  