File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
packages/react/src/Autocomplete Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @primer/react " : minor
3
+ ---
4
+
5
+ Convert Autocomplete to CSS modules behind feature flag
Original file line number Diff line number Diff line change
1
+ .Overlay {
2
+ overflow : auto;
3
+ }
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ import type {ComponentProps} from '../utils/types'
6
6
import { AutocompleteContext } from './AutocompleteContext'
7
7
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef'
8
8
import VisuallyHidden from '../_VisuallyHidden'
9
+ import { useFeatureFlag } from '../FeatureFlags'
10
+
11
+ import classes from './AutocompleteOverlay.module.css'
9
12
10
13
type AutocompleteOverlayInternalProps = {
11
14
/**
@@ -47,6 +50,8 @@ function AutocompleteOverlay({
47
50
setShowMenu ( false )
48
51
} , [ setShowMenu ] )
49
52
53
+ const enabled = useFeatureFlag ( 'primer_react_css_modules_team' )
54
+
50
55
if ( typeof window === 'undefined' ) {
51
56
return null
52
57
}
@@ -60,9 +65,14 @@ function AutocompleteOverlay({
60
65
ref = { floatingElementRef as React . RefObject < HTMLDivElement > }
61
66
top = { position ?. top }
62
67
left = { position ?. left }
63
- sx = { {
64
- overflow : 'auto' ,
65
- } }
68
+ sx = {
69
+ enabled
70
+ ? undefined
71
+ : {
72
+ overflow : 'auto' ,
73
+ }
74
+ }
75
+ className = { enabled ? classes . Overlay : undefined }
66
76
{ ...overlayProps }
67
77
>
68
78
{ children }
You can’t perform that action at this time.
0 commit comments