-
Notifications
You must be signed in to change notification settings - Fork 237
Read more button poc #12563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: latest
Are you sure you want to change the base?
Read more button poc #12563
Conversation
…ad-more-button-poc
…ad-more-button-poc
…the chosen services
<button | ||
css={[buttonStyle, styles.hideButtonOnDesktop]} | ||
type="button" | ||
onMouseDown={handleEvent} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for context on why these event handlers were used instead of onClick.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#notes
We want to show a focus indicator on the revealed element after the button is clicked/tapped/keyed. onClick didn't behave this way as focus was lost after clicking the button.
Resolves JIRA: https://jira.dev.bbc.co.uk/browse/WORLDSERVICE-505
A11y and screenreader requirements: https://paper.dropbox.com/doc/Article-Continue-Reading-button-a11y-screen-reader-UX--CjmSUEpk7TxVMR4HWApmH8HGAg-LZvihgQf7tXdezcUfP1ZB
Summary
Two variations on the now named 'Continue Reading' button are created. They are one component, with conditionally different styling. The functionality is the same for both variations.
Currently the variations are hard coded to be available on Pidgin and Urdu for variation A and Mundo and Arabic for variation B. This will be removed for the experiment. You can view the component on pages by changing
continueReadingEnabled = false,
to true in ArticlePage.tsx, and making the page smaller than desktop size. You can view the component on storybook.The component only shows on mobile widths.
When you click the button it moves the focus to the newly revealed paragraph, including a custom focus indicator. This also happens when navigating on keyboard or tapping on mobile.
Some pages have a lite site CTA under the headline which adds to the count of the blocks above the button. This is why we have a check for the lite site CTA being enabled: to see whether we need to add one to our count of where to put the button. The button should appear after 3 paragraphs.
Code changes
Developer Checklist
Testing
Ready-For-Test, Local
)Ready-For-Test, Test
)Ready-For-Test, Preview
)Ready-For-Test, Live
)Additional Testing Steps
Useful Links