Skip to content

Fix Job Dashboard actions menu on Safari#2947

Merged
donnchawp merged 1 commit into
trunkfrom
fix/safari-dashboard-actions-menu-2832
May 11, 2026
Merged

Fix Job Dashboard actions menu on Safari#2947
donnchawp merged 1 commit into
trunkfrom
fix/safari-dashboard-actions-menu-2832

Conversation

@donnchawp
Copy link
Copy Markdown
Contributor

@donnchawp donnchawp commented May 11, 2026

Summary

  • Drop the inline onfocusout + 100 ms setTimeout pattern on the <details> actions menu that ate clicks on Safari.
  • Close the menu from job-dashboard.js instead: outside pointerdown, Escape (with focus return), and bfcache restore.

Fixes #2832

Why this fixes Safari

The previous close was driven by focusout on the <details>, with a 100 ms timeout to allow a click inside to register first. Safari doesn't reliably focus elements on click (notably <summary> and inner <a>), so the relatedTarget check failed and the menu closed before the action link's navigation could fire. Replacing it with a document-level pointerdown outside-click and an Escape handler removes the focus dependency entirely.

The pageshow + event.persisted handler covers Safari's bfcache: previously a menu left open before clicking Edit would still be open after pressing Back.

Test plan

  • Safari: open three-dot menu, click each action — Edit / Mark Filled / Duplicate / Renew / Delete fire on first click
  • Safari: open menu, click Edit, press Back — menu is closed on return
  • Chrome / Firefox: no regression
  • Keyboard: Tab focuses summary, Enter opens, Esc closes and returns focus to the toggle
  • Click outside the menu closes it
  • make lint passes

Plugin build for 7d94ea6
📦 Download plugin zip
▶️ Open in playground

The actions menu used an inline `onfocusout` handler with a 100 ms
setTimeout to close the `<details>` element. On Safari, clicking a
link inside the dropdown caused the menu to close before the click
navigated, so Edit / Mark Filled / Duplicate / Renew / Delete all
failed to fire.

Drop the focus-based close and handle it from job-dashboard.js:
- Close on outside `pointerdown`.
- Close on Escape and return focus to the toggle.
- Close open menus on bfcache restore (`pageshow.persisted`) so
  Safari doesn't show a previously-open menu after Back/Forward.

Fixes #2832
@donnchawp donnchawp merged commit 2a01bd7 into trunk May 11, 2026
36 checks passed
@donnchawp donnchawp deleted the fix/safari-dashboard-actions-menu-2832 branch May 11, 2026 15:37
@donnchawp donnchawp added this to the 2.4.2 milestone May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Job Dashboard in Safari, Actions Not Performed in Actions Menu

1 participant