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

Focus the CKEditor content when clicking "Add notes"

Oliver Günther7798fd214bb7
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 2774d30a142..23fb85fa386 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
@@ -76,11 +76,11 @@ export default class extends Controller {
addNotes() {
this.notesInputTarget.classList.remove('d-none');
this.notesAddButtonTarget.classList.add('d-none');
- const textarea = this.element.querySelector('textarea[name="meeting_agenda_item[notes]"]');
setTimeout(() => {
- if (textarea) {
- (textarea as HTMLInputElement).focus();
+ const ckContent = this.element.querySelector<HTMLElement>('.ck-content');
+ if (ckContent) {
+ ckContent.focus();
}
- }, 100);
+ }, 50);
}
}