Check labels styles
We are use a display: block style for labels containing check boxes inside them, and the label has a width of 100%. This means that clicking on the blank space on the right of the label text will check/uncheck the checkbox. To avoid this behaviour we modify the "display" attribute of the labels. In order to prevent unexpected behaviour in terms_of_service form labels, we add specific css for this case when define a checkbox within the .actions class.
This commit is contained in:
@@ -25,7 +25,10 @@ class ConsulFormBuilder < FoundationRailsHelper::FormBuilder
|
||||
else
|
||||
label = tag.span sanitize(label_text(attribute, options[:label])), class: "checkbox"
|
||||
|
||||
super(attribute, options.merge(label: label, label_options: label_options_for(options)))
|
||||
super(attribute, options.merge(
|
||||
label: label,
|
||||
label_options: { class: "checkbox-label" }.merge(label_options_for(options))
|
||||
))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user