Conversation
cb2e1ce to
98ceab1
Compare
There was a problem hiding this comment.
🚩 Pre-existing: ReaderToolSwitch render-time code only removes 'turned-off', never re-adds it
The ReaderToolSwitch component at src/BloomBrowserUI/bookEdit/toolbox/readers/ReaderToolSwitch.tsx:18-22 only removes the turned-off class when checked is true, but never adds it back when checked is false. This means when switching from a reader book to a non-reader book, the tool content div will remain without turned-off, and isToggleOff() at src/BloomBrowserUI/bookEdit/toolbox/readers/readerTools.ts:638-643 will return false, causing setMarkupType(1) or setMarkupType(2) to be called for a non-reader book. This is a pre-existing issue (the same code path runs via showTool() → createToggle()) and is not introduced or worsened by this PR. The onChange handler correctly uses classList.toggle('turned-off', !checked) to handle user-initiated toggles. The fix would be to also add turned-off during render when checked is false.
(Refers to lines 18-22)
Was this helpful? React with 👍 or 👎 to provide feedback.
This change is