fix: wrap radiobutton in buttons to focus is visible

pull/3061/head
Audric Ackermann 1 year ago
parent 40a1bb4417
commit 321478682c

@ -64,14 +64,18 @@ export const SessionWrapperModal = (props: SessionWrapperModalType) => {
}; };
return ( return (
<FocusTrap focusTrapOptions={{ initialFocus: '#focus-trap-start' }}> <FocusTrap focusTrapOptions={{ initialFocus: '#focus-trap-start-wrapper' }}>
<div <div
className={classNames('loki-dialog modal', additionalClassName || null)} className={classNames('loki-dialog modal', additionalClassName || null)}
onClick={handleClick} onClick={handleClick}
role="dialog" role="dialog"
> >
{/* FocusTrap needs a button always mounted as a start, which is apparently not our case */} {/* FocusTrap needs a button always mounted as a start, which is apparently not our case */}
<button id="focus-trap-start" style={{ opacity: 0, width: 0, height: 0 }} /> <div
role="button"
id="focus-trap-start-wrapper"
style={{ opacity: 0, width: 0, height: 0 }}
/>
<div className="session-confirm-wrapper"> <div className="session-confirm-wrapper">
<div ref={modalRef} className="session-modal"> <div ref={modalRef} className="session-modal">
{showHeader ? ( {showHeader ? (

@ -67,10 +67,6 @@ const StyledButton = styled.button<{
'box-shadow: 0px 0px 6px var(--button-solid-shadow-color);'} 'box-shadow: 0px 0px 6px var(--button-solid-shadow-color);'}
border-radius: ${props => (props.buttonShape === SessionButtonShape.Round ? '17px' : '6px')}; border-radius: ${props => (props.buttonShape === SessionButtonShape.Round ? '17px' : '6px')};
:focus-within {
outline: 1px var(--primary-color) dashed;
}
.session-icon { .session-icon {
fill: var(--background-primary-color); fill: var(--background-primary-color);
} }

@ -21,10 +21,6 @@ const StyledInput = styled.input<{
? props.selectedColor ? props.selectedColor
: 'var(--primary-color)'}; : 'var(--primary-color)'};
} }
:focus-within + label:before {
outline: 1px var(--primary-color) dashed;
}
`; `;
// NOTE (Will): We don't use a transition because it's too slow and creates flickering when changing buttons. // NOTE (Will): We don't use a transition because it's too slow and creates flickering when changing buttons.
@ -87,6 +83,7 @@ export const SessionRadio = (props: SessionRadioProps) => {
const outlineOffset = 2; const outlineOffset = 2;
return ( return (
<button>
<Flex <Flex
container={true} container={true}
flexDirection={radioPosition === 'left' ? 'row' : 'row-reverse'} flexDirection={radioPosition === 'left' ? 'row' : 'row-reverse'}
@ -118,6 +115,7 @@ export const SessionRadio = (props: SessionRadioProps) => {
{label} {label}
</StyledLabel> </StyledLabel>
</Flex> </Flex>
</button>
); );
}; };

@ -37,10 +37,6 @@ const StyledSessionIconButton = styled.button<{ color?: string; isSelected?: boo
&:hover svg path { &:hover svg path {
${props => !props.color && 'fill: var(--button-icon-stroke-hover-color);'} ${props => !props.color && 'fill: var(--button-icon-stroke-hover-color);'}
} }
:focus-within {
outline: 1px var(--primary-color) dashed;
}
`; `;
// eslint-disable-next-line react/display-name // eslint-disable-next-line react/display-name

Loading…
Cancel
Save