Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Prevent default on language change so the page doesnt scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Aug 11, 2017
1 parent b70a72a commit 44bf706
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/api-explorer-ui/src/CodeSample.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function CodeSample({ oas, setLanguage, path, method }) {
role="link"
href="#"
className={`hub-lang-switch-${lang}`}
onClick={setLanguage.bind(null, lang)}
onClick={(e) => { e.preventDefault(); setLanguage(lang); }}
>{lang}</a>
</li>
),
Expand Down

0 comments on commit 44bf706

Please sign in to comment.