Fix various tasks when SL tool not initialized (BL-16068)#7790
Fix various tasks when SL tool not initialized (BL-16068)#7790JohnThomson wants to merge 1 commit intomasterfrom
Conversation
6214b50 to
4150dba
Compare
| function isToolInitialized(tool: ITool): boolean { | ||
| return !!getToolElement(tool); | ||
| } |
There was a problem hiding this comment.
🚩 isToolInitialized checks toolbox DOM, but detachFromPage operates on page content
isToolInitialized at line 1074 checks whether the tool's <h3> header exists in the #toolbox DOM. However, detachFromPage() for several tools (e.g., SignLanguageTool.detachFromPage removes click listeners from video containers on the page, GameTool.detachFromPage calls undoPrepareActivity(page)) operates on the page iframe content, not the toolbox DOM. If a tool was properly activated and then its h3 was removed (e.g., via adjustToolListForPage for requiresToolId tools), detachFromPage() would be skipped even though page-level cleanup is still needed. I traced the page-navigation flow and found that removeToolboxMarkup() calls detachFromPage() BEFORE the h3 is removed, so cleanup happens at the right time in the normal flow. But if there's any path where adjustToolListForPage runs without a prior removeToolboxMarkup(), this could result in missed cleanup.
Was this helpful? React with 👍 or 👎 to provide feedback.
This change is