Skip to content

Commit 994ce6a

Browse files
committed
Fixed tooltip layout issues in horizontal forms for CheckboxGroup and RadioGroup
1 parent 2066d28 commit 994ce6a

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/scripts/CheckboxGroup.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,19 @@ export const CheckboxGroup = createFC<
117117
{...rprops}
118118
onChange={onChange}
119119
>
120-
<div className='slds-grid slds-grid_vertical-align-center'>
121-
<legend className='slds-form-element__label'>
122-
{required ? (
123-
<abbr className='slds-required' title='required'>
124-
*
125-
</abbr>
126-
) : undefined}
127-
{label}
128-
</legend>
120+
<legend className='slds-form-element__label'>
121+
{required ? (
122+
<abbr className='slds-required' title='required'>
123+
*
124+
</abbr>
125+
) : undefined}
126+
{label}
129127
{tooltip ? (
130-
<TooltipContent icon={tooltipIcon}>{tooltip}</TooltipContent>
128+
<span className='slds-m-left_x-small'>
129+
<TooltipContent icon={tooltipIcon}>{tooltip}</TooltipContent>
130+
</span>
131131
) : null}
132-
</div>
132+
</legend>
133133
<div className='slds-form-element__control' ref={controlElRef}>
134134
<CheckboxGroupContext.Provider value={grpCtx}>
135135
{children}

src/scripts/RadioGroup.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,19 @@ export const RadioGroup = createFC<RadioGroupProps, { isFormElement: boolean }>(
9595
style={grpStyles}
9696
{...rprops}
9797
>
98-
<div className='slds-grid slds-grid_vertical-align-center'>
99-
<legend className='slds-form-element__label'>
100-
{required ? (
101-
<abbr className='slds-required' title='required'>
102-
*
103-
</abbr>
104-
) : undefined}
105-
{label}
106-
</legend>
98+
<legend className='slds-form-element__label'>
99+
{required ? (
100+
<abbr className='slds-required' title='required'>
101+
*
102+
</abbr>
103+
) : undefined}
104+
{label}
107105
{tooltip ? (
108-
<TooltipContent icon={tooltipIcon}>{tooltip}</TooltipContent>
106+
<span className='slds-m-left_x-small'>
107+
<TooltipContent icon={tooltipIcon}>{tooltip}</TooltipContent>
108+
</span>
109109
) : null}
110-
</div>
110+
</legend>
111111
<div className='slds-form-element__control'>
112112
<RadioGroupContext.Provider value={grpCtx}>
113113
{children}

0 commit comments

Comments
 (0)