bootstrap_form icon indicating copy to clipboard operation
bootstrap_form copied to clipboard

input appended to input

Open yucjk0120 opened this issue 1 year ago • 1 comments
trafficstars

I want to create input group like this with bootstrap_form. image It is made by following code.

<div class="input-group mb-3">
  <input type="text" class="form-control" placeholder="Username" aria-label="Username">
  <span class="input-group-text">@</span>
  <input type="text" class="form-control" placeholder="Server" aria-label="Server">
</div>

So, I thought it works well appending '@' and domain part input to username input.

= f.text_field :username, append: ['@', f.text_field_without_bootstrap(:domain)]

But this made... image

As L83 in lib/bootstrap_form/helpers/bootstrap.rb

      def input_group_content(content)
        return content if content.include?("btn")

        tag.span(content, class: "input-group-text")
      end

Other than btn tag, appending or prepending content will be surrounded by span tags.

Is there any prefer usage? or it may accept some input tags?

yucjk0120 avatar May 22 '24 08:05 yucjk0120