diff --git a/code/frontend/src/components/interactive/BoxConditionDatetime.js b/code/frontend/src/components/interactive/BoxConditionDatetime.js index 75b6157..2a1b9b5 100644 --- a/code/frontend/src/components/interactive/BoxConditionDatetime.js +++ b/code/frontend/src/components/interactive/BoxConditionDatetime.js @@ -35,7 +35,7 @@ export default function BoxConditionDatetime({ ...props }) { return setDatetime(text) } - const onButtonClick = () => { + const onButtonClick = e => { const naive = new Date(datetime) if(naive.toString() === "Invalid Date") { console.debug("Refusing to add condition: ", naive , " is an Invalid Date.") @@ -44,11 +44,14 @@ export default function BoxConditionDatetime({ ...props }) { const aware = convertToLocalISODate(naive) addCondition(new Condition("TIME", `${ba ? ">" : "<"} ${aware}`)) setDatetime("") + + // Prevent reloading the page! + e.preventDefault() } return ( Search by time period} {...props}> - + { + const onButtonClick = e => { addCondition(new Condition("HASHTAG", hashtag)) setHashtag("") + + // Prevent reloading the page! + e.preventDefault() } return ( Search by hashtag} {...props}> - + { + const onButtonClick = e => { addCondition(new Condition("USER", user)) setUser("") + + // Prevent reloading the page! + e.preventDefault() } return ( Search by user} {...props}> - +