Commit 1634ad1
Fix BL-16448 alignControlFrameWithActiveElement is not a function
https://issues.bloomlibrary.org/youtrack/issue/BL-16448
The exported adjustBackgroundImageSize() in CanvasElementBackgroundImageManager.ts
declared its optional cropInfo? parameter *before* two required callback
parameters (getActiveElement and alignControlFrameWithActiveElement). The
setupBackgroundImageAttributes() caller, which runs when opening the edit tab
for a page with a background image, omits cropInfo and passes only 6 args. Those
two callbacks then landed in the wrong parameter slots, leaving the real
alignControlFrameWithActiveElement parameter undefined. The later call to
alignControlFrameWithActiveElement() threw "alignControlFrameWithActiveElement
is not a function" (surfaced as an error toast).
This type-level mistake ("a required parameter cannot follow an optional
parameter") was not caught because the build uses Vite/esbuild, which strips TS
types without type-checking.
Fix: move cropInfo? to the end of adjustBackgroundImageSize()'s parameter list
(after the required callbacks) and update the matching call in
CanvasElementManager.adjustBackgroundImageSize to pass cropInfo last.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent a5e0af9 commit 1634ad1
2 files changed
Lines changed: 2 additions & 2 deletions
File tree
- src/BloomBrowserUI/bookEdit/js/canvasElementManager
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
297 | 296 | | |
298 | 297 | | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3122 | 3122 | | |
3123 | 3123 | | |
3124 | 3124 | | |
3125 | | - | |
3126 | 3125 | | |
3127 | 3126 | | |
| 3127 | + | |
3128 | 3128 | | |
3129 | 3129 | | |
3130 | 3130 | | |
| |||
0 commit comments