solidjs / solid-router

A universal router for Solid inspired by Ember and React Router
MIT License
1.1k stars 137 forks source link

HTML anchors with unicode id hash could not trigger page jump #421

Closed Reverier-Xu closed 1 month ago

Reverier-Xu commented 1 month ago

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

Additional context

image

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

Reverier-Xu commented 1 month ago

Any response here?

Reverier-Xu commented 1 month ago

Thank you!