From 5ad70efbd7859376bb8c0b6683214cf39d27ffac Mon Sep 17 00:00:00 2001 From: keyan Date: Fri, 13 Aug 2021 16:12:19 -0500 Subject: [PATCH] attempt at fixing 1 sat tooltip glitch --- components/action-tooltip.js | 9 ++++++++- components/upvote.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/action-tooltip.js b/components/action-tooltip.js index 5de6ae62..9421ee8e 100644 --- a/components/action-tooltip.js +++ b/components/action-tooltip.js @@ -1,6 +1,12 @@ +import { useFormikContext } from 'formik' import { OverlayTrigger, Tooltip } from 'react-bootstrap' -export default function ActionTooltip ({ children }) { +export default function ActionTooltip ({ children, notForm }) { + // if we're in a form, we want to hide tooltip on submit + let formik + if (!notForm) { + formik = useFormikContext() + } return ( } trigger={['hover', 'focus']} + show={formik?.isSubmitting ? false : undefined} > {children} diff --git a/components/upvote.js b/components/upvote.js index 8f7ca981..96756b06 100644 --- a/components/upvote.js +++ b/components/upvote.js @@ -36,7 +36,7 @@ export default function UpVote ({ itemId, meSats, className }) { return ( {({ strike }) => - +