From bb62e3c8fcdcf5c8b1d3da8104b68577981ec97b Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sun, 6 Sep 2020 23:43:50 +0200 Subject: [PATCH] Fix dropdown [ci skip] --- website/src/components/dropdown.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/website/src/components/dropdown.js b/website/src/components/dropdown.js index 4528ef77e..ae5c42415 100644 --- a/website/src/components/dropdown.js +++ b/website/src/components/dropdown.js @@ -6,7 +6,14 @@ import { navigate } from 'gatsby' import classes from '../styles/dropdown.module.sass' export default function Dropdown({ defaultValue, className, onChange, children }) { - const defaultOnChange = ({ target }) => navigate(target.value) + const defaultOnChange = ({ target }) => { + const isExternal = /((http(s?)):\/\/|mailto:)/gi.test(target.value) + if (isExternal) { + window.location.href = target.value + } else { + navigate(target.value) + } + } return (