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

fix focus on ckeditor when adding note

bsatarnejad926e4925cfd0
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 4c90dfcad70..dd20e439e3d 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
@@ -52,7 +52,9 @@ export default class extends Controller {
setTimeout(() => {
this.element.scrollIntoView({ block: 'center' });
- if (titleInput) {
+ if (window.getComputedStyle(this.notesInputTarget).display !== 'none') {
+ this.focusCkEditor();
+ } else if (titleInput) {
(titleInput as HTMLInputElement).focus();
}
}, 100);
@@ -76,6 +78,10 @@ export default class extends Controller {
addNotes() {
this.notesInputTarget.classList.remove('d-none');
this.notesAddButtonTarget.classList.add('d-none');
+ this.focusCkEditor();
+ }
+
+ private focusCkEditor() {
setTimeout(() => {
const ckContent = this.element.querySelector<HTMLElement>('.ck-content');
if (ckContent) {