Skip to content

Fix visibility of required asterisk on toggle checkboxes#473

Open
sanjacornelius wants to merge 1 commit into
developfrom
bugfix/FOUR-29727
Open

Fix visibility of required asterisk on toggle checkboxes#473
sanjacornelius wants to merge 1 commit into
developfrom
bugfix/FOUR-29727

Conversation

@sanjacornelius

@sanjacornelius sanjacornelius commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The required asterisk did not appear on checkboxes when toggle-style (custom-switch) was enabled. Bootstrap’s toggle styling uses ::before and ::after pseudo-elements on the control, which overlapped the asterisk placement and hid it from view.

This change adds a toggle-enabled class to RequiredAsterisk when used inside a toggle checkbox, and applies CSS to reposition the asterisk so it remains visible.

Solution

  • Add optional toggleEnabled prop to RequiredAsterisk
  • Pass toggle from FormCheckbox into RequiredAsterisk via :toggle-enabled
  • Apply toggle-enabled alongside required-asterisk when toggle mode is active
  • Add positioning styles (.required-asterisk.toggle-enabled) to offset the asterisk and avoid overlap with toggle pseudo-elements

Note:

Due to the layout of the toggle control, the asterisk appears in a different position than on a standard checkbox: before the toggle, rather than after the checkbox and before the label (the default placement).

Screenshot 2026-06-23 at 3 30 37 PM

How to test

  1. Render a required checkbox with toggle disabled, asterisk appears in the default position
  2. Render a required checkbox with toggle enabled, asterisk is visible and correctly positioned

Related Tickets

FOUR-29727

@processmaker-sonarqube

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants