mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
bug/63897 Missing target element "internalCheckbox" error when internal comments feature is disabled (#18856)
On wp comment form submit end, safely toggle internal comment state https://community.openproject.org/wp/63897 When the Internal comments feature is disabled, the internalCommentCheckboxTarget does not exist, causing a warning from Stimulus; the InternalCommentController listens to form submit end events from the activities IndexController which manages comment form submission- it is then able to update the UI state on form close. E.g. Ensuring that the background color is reset https://github.com/opf/openproject/commit/e4270942f935c127bf322955933c7bb81b93192b
This commit is contained in:
+5
-1
@@ -51,8 +51,12 @@ export default class InternalCommentController extends Controller {
|
||||
|
||||
declare isInternalValue:boolean;
|
||||
|
||||
declare hasInternalCheckboxTarget:boolean;
|
||||
|
||||
onSubmitEnd(_event:CustomEvent):void {
|
||||
this.toggleInternal();
|
||||
if (this.hasInternalCheckboxTarget) {
|
||||
this.toggleInternal();
|
||||
}
|
||||
}
|
||||
|
||||
toggleInternal():void {
|
||||
|
||||
Reference in New Issue
Block a user