Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins: Icons invisible when a large script is added on head.end #2589

Closed
personalizedrefrigerator opened this issue Jun 11, 2024 · 3 comments
Labels
bug Functionality does not match expectation
Milestone

Comments

@personalizedrefrigerator
Copy link

personalizedrefrigerator commented Jun 11, 2024

Search terms

script, defer, svg, head.end, body.begin, plugin, theme

Expected Behavior

The size of a script included in head.end should not affect whether icons are visible.

Actual Behavior

Large scripts cause most icons (dropdown icons, etc.) to be invisible. Adding defer to the script helps, but the icons are still sometimes invisible.

screenshot: Comparison between the expected and the actual behavior.

Steps to reproduce the bug

A minimal sample project with the issue can be found here.

More specifically,

  1. Clone https://github.com/personalizedrefrigerator/bug-report.git
  2. Switch to the typedoc/bug-include-script branch.
  3. Run npm i
  4. Run npm run build
  5. Run npm run doc
  6. Start a server: cd docs && python3 -m http.server.
  7. Open the documentation (tested in Firefox and Chromium on Ubuntu 24.04).

Environment

  • Typedoc version: 0.25.13
  • TypeScript version: 5.4.5
  • Node.js version: v22.1.0
  • OS: Ubuntu 24.04
@personalizedrefrigerator personalizedrefrigerator added the bug Functionality does not match expectation label Jun 11, 2024
@personalizedrefrigerator
Copy link
Author

To provide additional details, I have a custom TypeDoc theme that uses a head.end hook to add a script. For example,

renderer.hooks.on('head.end', (_event) => {
	return (
		// This happens with different libraries:
		//<script src="https://cdn.jsdelivr.net/npm/js-draw@1.20.3/dist/bundle.js" integrity="sha256-XJN7539P8FaFEZDXUEgMlp9ERBdhME2Gk7EoSZN2v3I=" crossOrigin="anonymous"></script>
		<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossOrigin="anonymous"></script>
	);
});

For reference, head.end's usage is documented here.

(Thank you for this excellent project!)

personalizedrefrigerator added a commit to personalizedrefrigerator/js-draw that referenced this issue Jun 11, 2024
Gerrit0 added a commit that referenced this issue Jun 11, 2024
@Gerrit0 Gerrit0 added this to the v0.26.0 milestone Jun 11, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 11, 2024

Oops, that's busted... at least it's an easy fix!

@Gerrit0 Gerrit0 mentioned this issue Jun 16, 2024
7 tasks
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 16, 2024

Fixed with 0.26, which is releasing 2024/06/21

@Gerrit0 Gerrit0 closed this as completed Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants