-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix FormBuilder to correctly forward block to TextField (#447)
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
demo/app/previews/form_builder_component_preview/text_field.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
<%= form_with(model: product, builder: Polaris::FormBuilder) do |form| %> | ||
<%= form.polaris_text_field(:title, help_text: "Note about text field") %> | ||
<% end %> | ||
|
||
<%= polaris_spacer(vertical: :base) %> | ||
|
||
<%= form_with(model: product, builder: Polaris::FormBuilder) do |form| %> | ||
<%= form.polaris_text_field(:title, help_text: "Note about text field") do |c| %> | ||
<% c.with_connected_left do %> | ||
<%= polaris_select( | ||
name: :weight_unit, | ||
label: "Weight unit", | ||
label_hidden: true, | ||
options: { "kd" => "kg", "lb" => "lb" }, | ||
selected: "kg", | ||
) %> | ||
<% end %> | ||
<% c.with_connected_right do %> | ||
<%= polaris_button { "Submit" } %> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters