Skip to content
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

PXBF-1996-bug-fix-button-group #2010

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 10 additions & 27 deletions benefit-finder/src/shared/components/Modal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<ObfuscatedLink
onClick={onClick}
onKeyDown={onKeyDown}
noCarrot
tabIndex="0"
triggerRef={triggerRef}
aria-label="Continue"
role="button"
>
{triggerLabel}
</ObfuscatedLink>
)
}

/**
* a functional component that renders a two links as a buttons for navigating out of the dialog
* @component
Expand Down Expand Up @@ -225,11 +202,17 @@ const Modal = ({

return (
<div id={id} className="bf-usa-modal-group">
<Trigger
triggerLabel={triggerLabel}
onKeyDown={e => handleKeyValidation(e) && handleOpenModal()}
<ObfuscatedLink
onClick={() => handleOpenModal()}
></Trigger>
onKeyDown={e => handleKeyValidation(e) && handleOpenModal()}
noCarrot
tabIndex="0"
triggerRef={triggerRef}
aria-label="Continue"
role="button"
>
{triggerLabel}
</ObfuscatedLink>
<NavModal
id="benefit-finder-modal"
isOpen={modalOpen}
Expand Down
Loading