solid-router icon indicating copy to clipboard operation
solid-router copied to clipboard

HTML anchors with unicode id hash could not trigger page jump

Open Reverier-Xu opened this issue 9 months ago • 0 comments

Describe the bug

When using Unicode characters such as Chinese or Japanese as the id of the title, the anchor tag cannot trigger a page jump, ascii characters work well.

Your Example Website or App

https://stackblitz.com/edit/solidjs-templates-exqpxd?file=src%2FApp.tsx

Steps to Reproduce the Bug or Issue

  1. Click the 你好世界 heading anchor in the page;
  2. the page does not have any actions;
  3. Click the Hello World heading anchor in the page;
  4. the page automatically scrolling to the heading position;
  5. Click the 僕はダメなんだ heading anchor in the page;
  6. page returns to the top unexpectedly.

Expected behavior

All the anchors should make the page scrolling to the corresponding heading.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: Microsoft Edge
  • Version: 124.0.2478.109

Additional context

image

there are two event listeners on the anchor tag, delete them could makes the functionality works as expected.

Reverier-Xu avatar May 17 '24 12:05 Reverier-Xu