Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#62126] Meeting outcomes form is not scrolled to automatically

Mir Bhatia7c17fbe345d5
diff --git a/frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts b/frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts
index 17adf57c017..f90e781f29e 100644
--- a/frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts
@@ -51,7 +51,10 @@ export default class extends Controller {
focusInput():void {
const titleInput = this.element.querySelector('input[name="meeting_agenda_item[title]"]');
- this.element.scrollIntoView({ block: 'center' });
+ setTimeout(() => {
+ this.element.scrollIntoView({ block: 'center' });
+ }, 0); // Needed because the elements added out of the current view aren't scrolled to otherwise
+
if (titleInput) {
(titleInput as HTMLInputElement).focus();
this.setCursorAtEnd(titleInput as HTMLInputElement);
diff --git a/modules/meeting/app/components/meeting_agenda_items/outcomes/form_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/outcomes/form_component.html.erb
index 45f8652dc6b..edcf2061af2 100644
--- a/modules/meeting/app/components/meeting_agenda_items/outcomes/form_component.html.erb
+++ b/modules/meeting/app/components/meeting_agenda_items/outcomes/form_component.html.erb
@@ -1,5 +1,5 @@
<%=
- component_wrapper(data: wrapper_data_attributes) do
+ component_wrapper do
primer_form_with(
model: @meeting_outcome,
method: @method,
@@ -8,10 +8,7 @@
flex_layout(tag: :div) do |flex|
flex.with_row(
mb: 2,
- data: {
- "test-selector": "meeting-outcome-input",
- "meeting-outcome-form-target": "notesInput"
- }
+ data: wrapper_data_attributes
) do
render(MeetingAgendaItem::Outcome::Notes.new(f))
end
diff --git a/modules/meeting/app/components/meeting_agenda_items/outcomes/form_component.rb b/modules/meeting/app/components/meeting_agenda_items/outcomes/form_component.rb
index 7600051dfe3..a16a1013dcb 100644
--- a/modules/meeting/app/components/meeting_agenda_items/outcomes/form_component.rb
+++ b/modules/meeting/app/components/meeting_agenda_items/outcomes/form_component.rb
@@ -50,10 +50,11 @@ module MeetingAgendaItems::Outcomes
private
def wrapper_data_attributes
- # {
- # controller: "meeting-outcome-form",
- # "application-target": "dynamic"
- # }
+ {
+ "test-selector": "meeting-outcome-input",
+ controller: "meeting-outcome-form",
+ "application-target": "dynamic"
+ }
end
end
end