Download Latest Version openpublisher5g_amd64-windows.exe (81.1 MB)
Home / 5.1.8
Name Modified Size InfoDownloads / Week
Parent folder
openpublisher5_amd64-windows-portable.exe 2026-09-28 183.2 MB
openpublisher5_amd64-windows.exe 2026-09-28 165.2 MB
openpublisher5_amd64-macos.dmg 2026-09-28 233.1 MB
openpublisher5_amd64-linux.run 2026-09-28 193.4 MB
openpublisher5_amd64-linux.rpm 2026-09-28 215.4 MB
openpublisher5_amd64-linux.flatpak 2026-09-28 153.6 MB
openpublisher5_amd64-linux.deb 2026-09-28 156.2 MB
openpublisher5_amd64-linux.AppImage 2026-09-28 176.6 MB
openpublisher5_amd64-freebsd.pkg 2026-09-28 185.5 MB
5.1.8_ Lock Aspect Ratio Checkbox Hit-Target Fix source code.tar.gz 2026-09-28 21.5 MB
5.1.8_ Lock Aspect Ratio Checkbox Hit-Target Fix source code.zip 2026-09-28 21.7 MB
README.md 2026-09-28 4.7 kB
Totals: 12 Items   1.7 GB 0

πŸš€ Summary

Version 5.1.8 resolves an intermittent but reproducible interaction bug in the Picture Tools ribbon tab where the Lock Aspect Ratio checkbox did not behave reliably. Some users found the checkbox itself was not clickable and only the text label to its right activated the toggle; others reported the exact opposite - the checkbox clicked fine but the text label did nothing. The underlying cause was the same in both cases: a JavaScript double-toggle race condition caused by mixing a manual div onclick toggle with the browser's own native checkbox toggle.


πŸ” Root Cause Analysis

The original implementation wrapped the checkbox and its text label in a plain <div> with an onclick handler that manually flipped cb.checked and called ContextRibbonActions.toggleAspectLock():

:::html
<!-- OLD - broken -->
<div onclick="const cb = document.getElementById('ribbon-el-lock');
              cb.checked = !cb.checked;
              ContextRibbonActions.toggleAspectLock(cb.checked);">
    <input type="checkbox" id="ribbon-el-lock"
           onchange="ContextRibbonActions.toggleAspectLock(this.checked);
                     event.stopPropagation();">
    <span>Lock aspect ratio</span>
</div>

When the user clicked the checkbox directly:

  1. The browser natively toggled checked (e.g., false to true).
  2. The onchange fired, calling toggleAspectLock(true) - correct so far.
  3. event.stopPropagation() was called on the change event - but this does not stop the parent div's click event from firing, because click and change are separate event types.
  4. The parent div onclick then fired, calling cb.checked = !cb.checked (toggling it back to false) and called toggleAspectLock(false).
  5. Net result: the checkbox appeared to do nothing (toggled twice, back to its original state).

When the user clicked the text span:

  1. No native checkbox toggle occurred.
  2. Only the div onclick fired, performing one toggle - which worked correctly.

The exact symptom (checkbox broken vs. text broken) varied between users depending on subtle browser differences in event propagation timing and whether event.stopPropagation() affected the outer click in their browser version.


πŸ› οΈ Fix

The fix replaces the div + onclick pattern with a standard HTML <label> element using the for attribute. This is the correct, browser-native mechanism for associating a label with a checkbox:

:::html
<!-- NEW - correct -->
<label for="ribbon-el-lock"
       style="display:flex; align-items:center; margin-top:2px;
              cursor:pointer; user-select:none;">
    <input type="checkbox" id="ribbon-el-lock"
           style="margin:0 4px 0 0; cursor:pointer;
                  accent-color: var(--ui-theme-color);"
           onchange="ContextRibbonActions.toggleAspectLock(this.checked);">
    <span class="ribbon-mini-label"
          style="user-select:none; cursor:pointer;">Lock aspect ratio</span>
</label>

Why this works reliably:

  • Clicking anywhere within the <label> (the checkbox itself, the text, or any gap between them) triggers exactly one native toggle of the associated <input>.
  • No JavaScript is involved in the toggle mechanism - the browser handles it natively and correctly.
  • onchange fires once per user interaction, calling toggleAspectLock exactly once with the new state.
  • The redundant manual cb.checked = !cb.checked and event.stopPropagation() are eliminated entirely.

πŸ§ͺ Verification

The fix was verified by inspecting the event flow:

Click target Old behavior New behavior
Checkbox box Toggle fired twice (no-op) Toggle fired once (correct)
Label text Toggle fired once (correct) Toggle fired once (correct)
Gap between Toggle fired once (correct) Toggle fired once (correct)

βœ… Checklist Completed

  • [x] ui/ui.js: Replaced <div onclick> wrapper with <label for="ribbon-el-lock"> in the Picture Tools size group, eliminating the double-toggle race condition.
  • [x] ui/ui.js: Removed redundant event.stopPropagation() from the checkbox onchange handler (no longer needed without the conflicting parent onclick).
  • [x] index.html: Bumped all script, stylesheet, and asset cachebusters from ?v=5.1.7 to ?v=5.1.8.
  • [x] ui/dashboard.js: Bumped template index fetch from ?v=5.1.7 to ?v=5.1.8.

πŸŽ‰ Version 5.1.8 - Open Publisher

Source: README.md, updated 2026-09-28