You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently when a markdown link is written like so: [something](#some-chapter) it will push this on top of the main URL: blitzar.cycraft.co/#some-chapter
bad workaround:
in the markdown URLs I can write [something](/docs/blitz-form#some-chapter) instead.
this is less than ideal however, because it's ugly and prone to break when I change routing
desired fix:
fix to be implemented at: DocPage.vue
you may need to create a new test page that uses DocPage.vue in planetar/packages/dev to reproduce the issue and implement this fix more easily
have DocPage detect when all examples/sections are mounted. (I'm listening to some events to know about this already)
then scrape the DOM for all links in the markdown sections that start with #, and then attach an eventListener that does e.preventDefault() and e.stopPropagation()
use Quasar scroll utils to scroll to the element
the duration that it takes to have Quasar scroll to the element should be SCROLL_DURATION (do a global search for this in planetar)
after clicking a link and after the scroll is complete the hashtag scrolled to, should be added to the URL in the browser:
this setUrlHash is also used by TOC.vue? so this logic should be in a planetar/packages/doc-builder/src/helpers/utils.ts file or something and imported into both TOC.vue and DocPage.vue
The text was updated successfully, but these errors were encountered:
mesqueeb
changed the title
fix(docs): make markdown hashtag links scroll to elements properly
fix(doc-page): make markdown hashtag links scroll to elements properly
Oct 14, 2020
steps to reproduce:
reason:
[something](#some-chapter)
it will push this on top of the main URL:blitzar.cycraft.co/#some-chapter
bad workaround:
[something](/docs/blitz-form#some-chapter)
instead.desired fix:
DocPage.vue
DocPage.vue
inplanetar/packages/dev
to reproduce the issue and implement this fix more easily#
, and then attach an eventListener that doese.preventDefault()
ande.stopPropagation()
SCROLL_DURATION
(do a global search for this in planetar)setUrlHash
is also used by TOC.vue? so this logic should be in aplanetar/packages/doc-builder/src/helpers/utils.ts
file or something and imported into both TOC.vue and DocPage.vueThe text was updated successfully, but these errors were encountered: