Skip to content

Fix clipboard IIFE broken by Bootstrap defer#75

Merged
mjradwin merged 1 commit into
mainfrom
claude/script-defer-audit-ea94ln
Jun 23, 2026
Merged

Fix clipboard IIFE broken by Bootstrap defer#75
mjradwin merged 1 commit into
mainfrom
claude/script-defer-audit-ea94ln

Conversation

@mjradwin

Copy link
Copy Markdown
Member

The previous PR added defer to the Bootstrap bundle. This exposed a bug in client-clipboard.js: the IIFE called new bootstrap.Tooltip() synchronously, but with Bootstrap deferred it hasn't executed yet at that point.

Fix: wrap the clipboard code in a DOMContentLoaded listener. Deferred scripts are guaranteed to run before DOMContentLoaded fires, so Bootstrap will be available when the listener executes.


Generated by Claude Code

Wrapping in DOMContentLoaded ensures bootstrap.Tooltip is available,
since deferred scripts execute before DOMContentLoaded fires.
@mjradwin mjradwin merged commit 0912be7 into main Jun 23, 2026
5 checks passed
@sonarqubecloud

Copy link
Copy Markdown

@mjradwin mjradwin deleted the claude/script-defer-audit-ea94ln branch June 23, 2026 16:05
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.

2 participants