Skip to content

Commit

Permalink
fix: fields x overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Dec 16, 2024
1 parent 77b412b commit 3c32a90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/avo/field_wrapper_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<% end %>
<% if on_edit? && @field.is_required? %> <span class="text-red-600 ml-1">*</span> <% end %>
<% end %>
<%= content_tag :div, class: class_names("flex-1 flex flex-row md:min-h-inherit px-6",
<%= content_tag :div, class: class_names("flex-1 flex flex-row md:min-h-inherit px-6 overflow-x-auto",
@field.get_html(:classes, view: @view, element: :content),
{
"pb-4": stacked?,
"py-2": !compact?,
"py-1": compact?,
}), data: {slot: "value"} do %>
<div class="self-center w-full <% unless full_width? || compact? || stacked? %> md:w-8/12 has-sidebar:w-full <% end %>">
<div class="self-center w-full overflow-x-auto <% unless full_width? || compact? || stacked? %> md:w-8/12 has-sidebar:w-full<% end %>">
<% if on_show? %>
<% if render_dash? %>
Expand Down
3 changes: 3 additions & 0 deletions spec/dummy/app/avo/resources/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def main_panel_fields
required: true,
only_on: [:index]

field :some_token

field :is_writer, as: :text,
sortable: -> {
# Order by something else completely, just to make a test case that clearly and reliably does what we want.
Expand Down Expand Up @@ -154,6 +156,7 @@ def test_sidebar

def main_panel_sidebar
sidebar do
field :some_token
test_field("Inside main_panel_sidebar")
with_options only_on: :show do
field :email, as: :gravatar, link_to_record: true, as_avatar: :circle
Expand Down
2 changes: 2 additions & 0 deletions spec/dummy/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@ def permissions
delete: true,
}
end

def some_token = @some_token ||= SecureRandom.hex(64)
end

0 comments on commit 3c32a90

Please sign in to comment.