From 1eac82eaf1e6b434c3dd0c71fba8083bc5142f70 Mon Sep 17 00:00:00 2001 From: scottqueen-bixal Date: Mon, 16 Dec 2024 14:12:56 -0500 Subject: [PATCH] PXBF-1996-bug-fix-button-group: lifting component to parent render process to avoid unecessary re-renders --- .../src/shared/components/Modal/index.jsx | 37 +++++-------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/benefit-finder/src/shared/components/Modal/index.jsx b/benefit-finder/src/shared/components/Modal/index.jsx index e3cf5765..3006810d 100644 --- a/benefit-finder/src/shared/components/Modal/index.jsx +++ b/benefit-finder/src/shared/components/Modal/index.jsx @@ -137,29 +137,6 @@ const Modal = ({ }) }, [modalOpen]) - /** - * a functional component that renders a link as a button for launching our dialog - * @component - * @param {string} id - matches to modal control - * @param {string} triggerLabel - passed to button for triggering modal - * @return {html} returns an obfuscated anchor element - */ - const Trigger = ({ triggerLabel, onKeyDown, onClick }) => { - return ( - - {triggerLabel} - - ) - } - /** * a functional component that renders a two links as a buttons for navigating out of the dialog * @component @@ -225,11 +202,17 @@ const Modal = ({ return (
- handleKeyValidation(e) && handleOpenModal()} + handleOpenModal()} - > + onKeyDown={e => handleKeyValidation(e) && handleOpenModal()} + noCarrot + tabIndex="0" + triggerRef={triggerRef} + aria-label="Continue" + role="button" + > + {triggerLabel} +