Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

fix(docz): non latin menu headings #840

Merged
merged 1 commit into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export const SmallLink: SFC<SmallLinkProps> = ({
const [isActive, setActive] = useState(false)

useEffect(() => {
const currentHash = location.hash && location.hash.slice(1, Infinity)
const decodedHash = decodeURI(location.hash)
const currentHash = decodedHash && decodedHash.slice(1, Infinity)
setActive(Boolean(slug === currentHash))
}, [location])

Expand Down
3 changes: 2 additions & 1 deletion core/docz/src/components/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export interface RoutesProps {
const goToHash = ({ location }: HistoryListenerParameter) => {
setTimeout(() => {
if (location && location.hash) {
const id: string = location.hash.substring(1)
const decodedHash = decodeURI(location.hash)
const id: string = decodedHash.substring(1)
const el: HTMLElement | null = document.getElementById(id)
if (el) el.scrollIntoView()
}
Expand Down