Skip to content

Commit

Permalink
Only increase the height of the dialog when it is really needed. In e…
Browse files Browse the repository at this point in the history
…dit mode, the autocompleter is disabled and thus does not have to be increased
  • Loading branch information
HDinger committed Dec 3, 2024
1 parent 148c6fd commit be92e46
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
size: :large,
id: DIALOG_ID)) do |d|
d.with_header(variant: :large)
d.with_body(classes: "Overlay-body_autocomplete_height") do
d.with_body(classes: body_classes) do
render(WorkPackageRelationsTab::AddWorkPackageChildFormComponent.new(
work_package: @work_package
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@ def dialog_title
child_label = t("#{I18N_NAMESPACE}.relations.label_child_singular")
t("#{I18N_NAMESPACE}.label_add_x", x: child_label)
end

def body_classes
"Overlay-body_autocomplete_height"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
size: :large,
id: DIALOG_ID)) do |d|
d.with_header(variant: :large)
d.with_body(classes: "Overlay-body_autocomplete_height") do
d.with_body(classes: body_classes) do
render(WorkPackageRelationsTab::WorkPackageRelationFormComponent.new(
work_package: @work_package,
relation: @relation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,8 @@ def dialog_title
t("#{I18N_NAMESPACE}.label_add_x", x: relation_label)
end
end

def body_classes
@relation.persisted? ? nil : "Overlay-body_autocomplete_height"
end
end

0 comments on commit be92e46

Please sign in to comment.