Repository: primer/view_components (Ruby)

Issue:
Setting properties on a form control when using the form builder
I am trying to use the autocomplete component from within a form builder:

```ruby
class MyForm < ApplicationForm
  form do |form|
    form.auto_complete(
      name: :skills,
      label: "Skills",
      placeholder: "Search skills library",
      required: true,
      list_id: "skills_autocomplete",
      src: "/skills/autocomplete?select_fields=id,name,description&search_field=name",
    )
  end
end
```

This renders a `FormControl` with the autocomplete inside and that is all great. However I want to set the form control to be full width. There is a property for this available on the form control but that seems to be inaccessible from here.

Is there a way to modify the values passed to the form control so we can set properties on it?

Thanks for your help


Discussion:
Uh oh! @dereke, the image you shared is missing helpful alt text. Check  your issue body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at [Basic writing and formatting syntax: images on GitHub Docs](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#images).

> 🤖 Beep boop! This comment was added automatically by [github/accessibility-alt-text-bot](https://github.com/github/accessibility-alt-text-bot).

Hey @dereke, thanks for bringing this to our attention 😄 It should be mitigated by https://github.com/primer/view_components/pull/3205 👍 
Amazing - thanks so much! ❤️ 



Patch:
diff --git a/.changeset/seven-experts-return.md b/.changeset/seven-experts-return.md
new file mode 100644
index 0000000000..27c4dc91c7
--- /dev/null
+++ b/.changeset/seven-experts-return.md
@@ -0,0 +1,5 @@
+---
+'@primer/view-components': patch
+---
+
+Ensure `full_width:` option is respected by the auto_complete input
diff --git a/app/lib/primer/forms/auto_complete.rb b/app/lib/primer/forms/auto_complete.rb
index f1e2d48506..f2f8353b97 100644
--- a/app/lib/primer/forms/auto_complete.rb
+++ b/app/lib/primer/forms/auto_complete.rb
@@ -40,7 +40,8 @@ def auto_complete_arguments
             input_name: all_args[:name],
             input_id: all_args[:id],
             label_text: @input.label,
-            list_id: "#{all_args[:id]}-list"
+            list_id: "#{all_args[:id]}-list",
+            full_width: @input.full_width?
           )
       end
 


Test patch:
diff --git a/test/lib/primer/forms/auto_complete_input_test.rb b/test/lib/primer/forms/auto_complete_input_test.rb
index 6c91285227..a750d2247f 100644
--- a/test/lib/primer/forms/auto_complete_input_test.rb
+++ b/test/lib/primer/forms/auto_complete_input_test.rb
@@ -36,4 +36,28 @@ def test_only_primer_error_markup
     # no rails error markup
     refute_selector ".field_with_errors", visible: :all
   end
+
+  def test_full_width_by_default
+    render_in_view_context do
+      primer_form_with(url: "/foo") do |f|
+        render_inline_form(f) do |auto_complete_form|
+          auto_complete_form.auto_complete(name: :foo, label: "Foo", src: "/foo")
+        end
+      end
+    end
+
+    assert_selector ".FormControl--fullWidth"
+  end
+
+  def test_full_width_can_be_disabled
+    render_in_view_context do
+      primer_form_with(url: "/foo") do |f|
+        render_inline_form(f) do |auto_complete_form|
+          auto_complete_form.auto_complete(name: :foo, label: "Foo", src: "/foo", full_width: false)
+        end
+      end
+    end
+
+    refute_selector ".FormControl--fullWidth"
+  end
 end