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

Sidebar: wrong anchor hash for messages #1109

Open
FelixPopp opened this issue Nov 25, 2024 · 1 comment
Open

Sidebar: wrong anchor hash for messages #1109

FelixPopp opened this issue Nov 25, 2024 · 1 comment

Comments

@FelixPopp
Copy link

Description
The anchor link for a message in the sidebar does not work as expected when message.name() and message.id() differ.

Expected result
Clicking on a message in the sidebar should set the correct hash in the URL and scroll the message into view.

Actual result
The anchor link only works if message.name() and message.id() are identical.
If message.name() is not provided, the hash becomes #message-undefined.

Steps to reproduce

  1. Open the AsyncAPI React Playground App
  2. Enable the sidebar in the configuration tab
  3. Links in the sidebar for message lightMeasured Message ID and LwM2mOjbects won't work.
    Example: The anchor hash for LwM2mOjbects is #message-undefined because message.name is not provided.
    Screenshot 2024-11-25 122934

Troubleshooting

  • The HTML-ID for a message is set to message.id() in Messages.tsx#L32
  • However, the anchor links in the sidebar use message.name() as the hash target, defined in Sidebar.tsx#L44
@parthikjadav
Copy link

ya i chacked it and thats true it is having error but i had fixed it

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

No branches or pull requests

2 participants