Skip to content

Commit

Permalink
Fix: Add missing form-control-color class for color_field (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
aydinkazim authored Oct 13, 2024
1 parent 4cfc7ac commit d177832
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/bootstrap_form/inputs/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def bootstrap_field(field_name)
define_method :"#{field_name}_with_bootstrap" do |name, options={}|
warn_deprecated_layout_value(options)
options = options.reverse_merge(control_class: "form-range") if field_name == :range_field
options = options.reverse_merge(control_class: "form-control form-control-color") if field_name == :color_field
form_group_builder(name, options) do
prepend_and_append_input(name, options) do
options[:placeholder] ||= name if options[:floating]
Expand Down
2 changes: 1 addition & 1 deletion test/bootstrap_fields_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class BootstrapFieldsTest < ActionView::TestCase
expected = <<~HTML
<div class="mb-3">
<label class="form-label" for="user_misc">Misc</label>
<input class="form-control" id="user_misc" name="user[misc]" type="color" value="#000000" />
<input class="form-control form-control-color" id="user_misc" name="user[misc]" type="color" value="#000000" />
</div>
HTML
assert_equivalent_html expected, @builder.color_field(:misc)
Expand Down

0 comments on commit d177832

Please sign in to comment.