ncthbrt / nact.xyz

Site for nact documentation
https://nact.xyz
MIT License
10 stars 15 forks source link

Table of contents of JS lessons is out of order #19

Closed ankon closed 5 years ago

ankon commented 6 years ago

screen-nact io-toc-order

I had a brief look, but failed to get gatsby develop/serve to work. I suspect that the problem is around here: https://github.com/ncthbrt/nact.io/blob/4ca060208e158b0dea21fcc85aecbf32af54e4cd/src/components/Layout/TableOfContents.jsx#L36 -- instead of using > and returning a boolean the compare function for Array.sort should return <0/0/>0 values.

ncthbrt commented 6 years ago

@ankon What browser are you using? It renders correctly on Firefox, assuming it's due to the implementation of sorting on your particular browser. Would like to be able to reproduce the problem.

ankon commented 6 years ago
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3551.3 Safari/537.36

That is "google-chrome-unstable" on Fedora, from the official repositories.

screen-chrome-sort

BruceWeng commented 5 years ago

Hi @ncthbrt, I made a PR on solving this issue at Fix Bug: Table of Contents Lesson Number Unordered #21. Let me know if you have any concern to merge 👍