Adds renderContentAlways prop to Accordion, improving keyboard and assistive tech usability config upstream
Adds UTs
Updates Stories
We useEffect to first check if renderContentAlways is true. If it is, we set shouldRender to true and skip the rest of the checks. If renderContentAlways is false, we then check if expanded is true. If it is, we set shouldRender to true and clear any existing timeout. If expanded is false, we start a timeout that sets shouldRender to false after 400ms, affording time for the animation to complete.
SUMMARY:
renderContentAlways
prop toAccordion
, improving keyboard and assistive tech usability config upstreamWe useEffect to first check if
renderContentAlways
istrue
. If it is, we setshouldRender
totrue
and skip the rest of the checks. IfrenderContentAlways
isfalse
, we then check ifexpanded
istrue
. If it is, we setshouldRender
totrue
and clear any existing timeout. Ifexpanded
isfalse
, we start a timeout that setsshouldRender
tofalse
after400ms
, affording time for the animation to complete.https://github.com/EightfoldAI/octuple/assets/99700808/ca9a3c01-b74a-4f85-8772-2d2675a7ecc4
JIRA TASK (Eightfold Employees Only):
ENG-86284
CHANGE TYPE:
TEST COVERAGE:
TEST PLAN:
Pull the PR branch and run
yarn
andyarn storybook
. Verify theAccordion
stories behave as expected.