From 40f71cb79b2e812377dd510a1d9dafd25bc51d82 Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Wed, 21 Jun 2023 10:38:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20accessibility=20issue=20?= =?UTF-8?q?with=20hidden=20success=20message=20in=20signup=20form?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://ghost.slack.com/archives/CTH5NDJMS/p1686928938857799 The button read 'Subscribe email sent' on screen readers. --- apps/signup-form/assets/icons/spinner.svg | 4 ++-- apps/signup-form/src/components/pages/FormView.tsx | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/signup-form/assets/icons/spinner.svg b/apps/signup-form/assets/icons/spinner.svg index 4616576d1b..1f5607a13d 100644 --- a/apps/signup-form/assets/icons/spinner.svg +++ b/apps/signup-form/assets/icons/spinner.svg @@ -1,4 +1,4 @@ - + @@ -14,4 +14,4 @@ @keyframes nc-loop-dots-4-anim{0%,100%{opacity:.4;transform:scale(.75)}50%{opacity:1;transform:scale(1)}} - \ No newline at end of file + diff --git a/apps/signup-form/src/components/pages/FormView.tsx b/apps/signup-form/src/components/pages/FormView.tsx index 8f4b5f2ad8..200a3475a7 100644 --- a/apps/signup-form/src/components/pages/FormView.tsx +++ b/apps/signup-form/src/components/pages/FormView.tsx @@ -56,6 +56,7 @@ const Form: React.FC = ({isMinimal, loading, success, error, buttonCo onSubmit({email}); }; + // The complicated transitions are here so that we animate visibility: hidden (step-start/step-end), which is required for screen readers to know what is visible (they ignore opacity: 0) return ( <>
@@ -75,9 +76,9 @@ const Form: React.FC = ({isMinimal, loading, success, error, buttonCo style={{backgroundColor: buttonColor, color: buttonTextColor}} type='submit' > - {t('Subscribe')} - {isMinimal && {t('Email sent')}} - + {t('Subscribe')} + {isMinimal && {t('Email sent')}} +