Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix: Add missing form-control-color class for color_field #739

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading