fix: replace whitespace with a - so that ids are valid and scroll to works (#4710)

Co-authored-by: Tom Pridham <pridham.tom@gmail.com>
This commit is contained in:
Frank Noirot
2024-12-09 16:10:33 -05:00
committed by GitHub
parent 943cf21d34
commit 54153aa646
3 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ export function KeybindingsSectionsList({
key={category}
onClick={() =>
scrollRef.current
?.querySelector(`#category-${category}`)
?.querySelector(`#category-${category.replaceAll(/\s/g, '-')}`)
?.scrollIntoView({
block: 'center',
behavior: 'smooth',