vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

When clicking on the favorite and delete buttons in the docSearch box, the link will jump

Open zonemeen opened this issue 1 year ago • 3 comments

Describe the bug

When clicking on the favorite and delete buttons in the docSearch box, the link will jump.

docSearch-button-bug

Reproduction

https://vitepress.vuejs.org/

Expected behavior

When clicking on the favorite and delete buttons in the docSearch box, the link do not jump.

docSearch-button-normal

docSearch-button

System Info

System:
  OS: Windows 10 10.0.19044
  CPU: (8) x64 Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz
  Memory: 2.59 GB / 15.9 GB
Binaries:
  Node: 16.10.0 - C:\Program Files\nodejs\node
  Yarn: 1.22.17 - C:\Program Files\nodejs\yarn
  npm: 7.24.0 - C:\Program Files\nodejs\npm
  pnpm: 7.2.1 - C:\Program Files\nodejs\pnpm
Browsers:
  Chromium (104.0.5112.79)

Additional context

No response

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

zonemeen avatar Aug 08 '22 02:08 zonemeen

@brc-dd Hi, I submitted a PR that included a solution.

zonemeen avatar Aug 08 '22 02:08 zonemeen

Sorry, but this fix should not be required at our end. According to HTML5 spec, a button cannot be nested inside an anchor tag. DocSearch is creating invalid HTML. I'll create an issue there.

brc-dd avatar Aug 08 '22 08:08 brc-dd

Ok, I will close this pr, thanks for your work. 😀

zonemeen avatar Aug 08 '22 09:08 zonemeen