Skip to content

Commit 6c4c57d

Browse files
authored
fix: S2 Badge context (#7704)
* fix: S2 Badge context * fix lint
1 parent 2788d8a commit 6c4c57d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/@react-spectrum/s2/src/Badge.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';
1414
import {centerBaseline} from './CenterBaseline';
1515
import {centerPadding, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
16-
import {ContextValue, Provider, SlotProps} from 'react-aria-components';
16+
import {ContextValue, Provider, TextContext as RACTextContext, SlotProps} from 'react-aria-components';
1717
import {filterDOMProps} from '@react-aria/utils';
1818
import {fontRelative, lightDark, style} from '../style' with {type: 'macro'};
1919
import {IconContext} from './Icon';
@@ -210,14 +210,15 @@ export const Badge = forwardRef(function Badge(props: BadgeProps, ref: DOMRef<HT
210210
values={[
211211
[TextContext, {
212212
styles: style({
213-
paddingY: '--labelPadding',
214-
order: 1,
215-
overflowX: 'hidden',
216-
overflowY: 'hidden',
217-
textOverflow: 'ellipsis',
213+
paddingY: '--labelPadding',
214+
order: 1,
215+
overflowX: 'hidden',
216+
overflowY: 'hidden',
217+
textOverflow: 'ellipsis',
218218
whiteSpace: {overflowMode: {truncate: 'nowrap', wrap: 'normal'}}
219219
})({overflowMode})
220220
}],
221+
[RACTextContext, {}],
221222
[IconContext, {
222223
render: centerBaseline({slot: 'icon', styles: style({order: 0})}),
223224
styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})

0 commit comments

Comments
 (0)