Skip to content

Commit 8c28861

Browse files
authored
docs(autoalign): clarify reliance on react v17+ (#19943)
1 parent 465d82a commit 8c28861

24 files changed

+113
-33
lines changed

packages/react/src/components/AILabel/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ AILabel.propTypes = {
291291
'aria-label': PropTypes.string,
292292

293293
/**
294-
* Will auto-align the popover. This prop is currently experimental and is subject to future changes.
294+
* Will auto-align the popover. This prop is currently experimental and is
295+
* subject to future changes. Requires React v17+
296+
* @see https://github.com/carbon-design-system/carbon/issues/18714
295297
*/
296298
autoAlign: PropTypes.bool,
297299

packages/react/src/components/Button/Button.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ const Button: ButtonComponent = React.forwardRef(
245245
]),
246246

247247
/**
248-
* **Experimental**: Will attempt to automatically align the tooltip
248+
* **Experimental**: Will attempt to automatically align the tooltip. Requires
249+
* React v17+
250+
* @see https://github.com/carbon-design-system/carbon/issues/18714
249251
*/
250252
autoAlign: PropTypes.bool,
251253

packages/react/src/components/CodeSnippet/CodeSnippet.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export interface CodeSnippetProps {
5050
align?: CodeSnippetAlignment;
5151

5252
/**
53-
* **Experimental**: Will attempt to automatically align the tooltip
53+
* **Experimental**: Will attempt to automatically align the tooltip. Requires React v17+
54+
* @see https://github.com/carbon-design-system/carbon/issues/18714
5455
*/
5556
autoAlign?: boolean;
5657

@@ -486,7 +487,9 @@ CodeSnippet.propTypes = {
486487
),
487488

488489
/**
489-
* **Experimental**: Will attempt to automatically align the tooltip
490+
* **Experimental**: Will attempt to automatically align the tooltip. Requires
491+
* React v17+
492+
* @see https://github.com/carbon-design-system/carbon/issues/18714
490493
*/
491494
autoAlign: PropTypes.bool,
492495

packages/react/src/components/ComboBox/ComboBox.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ export interface ComboBoxProps<ItemType>
200200
/**
201201
* **Experimental**: Will attempt to automatically align the floating
202202
* element to avoid collisions with the viewport and being clipped by
203-
* ancestor elements.
203+
* ancestor elements. Requires React v17+
204+
* @see https://github.com/carbon-design-system/carbon/issues/18714
204205
*/
205206
autoAlign?: boolean;
206207

@@ -1229,7 +1230,8 @@ ComboBox.propTypes = {
12291230
/**
12301231
* **Experimental**: Will attempt to automatically align the floating
12311232
* element to avoid collisions with the viewport and being clipped by
1232-
* ancestor elements.
1233+
* ancestor elements. Requires React v17+
1234+
* @see https://github.com/carbon-design-system/carbon/issues/18714
12331235
*/
12341236
autoAlign: PropTypes.bool,
12351237

packages/react/src/components/ComboBox/Combobox.DynamicStyles.featureflag.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ without the collision detection.
2121
**Note**: The flag has no effect when used with `autoAlign` because `autoAlign`
2222
includes both the dynamic positioning styles and collision detection.
2323

24+
To use `autoAlign` your project needs to be using React v17+, see
25+
https://github.com/carbon-design-system/carbon/issues/18714.
26+
2427
## Enable dynamic setting of floating styles
2528

2629
```js
@@ -45,7 +48,8 @@ includes both the dynamic positioning styles and collision detection.
4548
additionalActions={[
4649
{
4750
title: 'Open in Stackblitz',
48-
onClick: () => stackblitzPrefillConfig(ComboBoxFeatureflagStories.FloatingStyles),
51+
onClick: () =>
52+
stackblitzPrefillConfig(ComboBoxFeatureflagStories.FloatingStyles),
4953
},
5054
]}
51-
/>
55+
/>

packages/react/src/components/ComboButton/ComboButton.DynamicStyles.featureflag.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ without the collision detection.
2121
**Note**: The flag has no effect when used with `autoAlign` because `autoAlign`
2222
includes both the dynamic positioning styles and collision detection.
2323

24+
To use `autoAlign` your project needs to be using React v17+, see
25+
https://github.com/carbon-design-system/carbon/issues/18714.
26+
2427
## Enable dynamic setting of floating styles
2528

2629
```js
@@ -41,7 +44,8 @@ includes both the dynamic positioning styles and collision detection.
4144
additionalActions={[
4245
{
4346
title: 'Open in Stackblitz',
44-
onClick: () => stackblitzPrefillConfig(ComboButtonFeatureflagStories.FloatingStyles),
47+
onClick: () =>
48+
stackblitzPrefillConfig(ComboButtonFeatureflagStories.FloatingStyles),
4549
},
4650
]}
47-
/>
51+
/>

packages/react/src/components/Copy/Copy.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ export interface CopyProps
4242
align?: CopyAlignment;
4343

4444
/**
45-
* **Experimental**: Will attempt to automatically align the tooltip
45+
* **Experimental**: Will attempt to automatically align the tooltip. Requires React v17+
46+
* @see https://github.com/carbon-design-system/carbon/issues/18714
4647
*/
4748
autoAlign?: boolean;
4849

@@ -191,7 +192,9 @@ Copy.propTypes = {
191192
),
192193

193194
/**
194-
* **Experimental**: Will attempt to automatically align the tooltip
195+
* **Experimental**: Will attempt to automatically align the tooltip. Requires
196+
* React v17+
197+
* @see https://github.com/carbon-design-system/carbon/issues/18714
195198
*/
196199
autoAlign: PropTypes.bool,
197200

packages/react/src/components/CopyButton/CopyButton.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export interface CopyButtonProps extends ButtonProps<'button'> {
3535
align?: CopyButtonAlignment;
3636

3737
/**
38-
* **Experimental**: Will attempt to automatically align the tooltip
38+
* **Experimental**: Will attempt to automatically align the tooltip. Requires React v17+
39+
* @see https://github.com/carbon-design-system/carbon/issues/18714
3940
*/
4041
autoAlign?: boolean;
4142

@@ -145,7 +146,9 @@ CopyButton.propTypes = {
145146
),
146147

147148
/**
148-
* **Experimental**: Will attempt to automatically align the tooltip
149+
* **Experimental**: Will attempt to automatically align the tooltip. Requires
150+
* React v17+
151+
* @see https://github.com/carbon-design-system/carbon/issues/18714
149152
*/
150153
autoAlign: PropTypes.bool,
151154

packages/react/src/components/Dropdown/Dropdown.DynamicStyles.featureflag.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ without the collision detection.
2121
**Note**: The flag has no effect when used with `autoAlign` because `autoAlign`
2222
includes both the dynamic positioning styles and collision detection.
2323

24+
To use `autoAlign` your project needs to be using React v17+, see
25+
https://github.com/carbon-design-system/carbon/issues/18714.
26+
2427
## Enable dynamic setting of floating styles
2528

2629
```js
@@ -40,12 +43,14 @@ includes both the dynamic positioning styles and collision detection.
4043
/>
4144
</FeatureFlags>
4245
```
46+
4347
<Canvas
4448
of={DropdownFeatureflagStories.FloatingStyles}
4549
additionalActions={[
4650
{
4751
title: 'Open in Stackblitz',
48-
onClick: () => stackblitzPrefillConfig(DropdownFeatureflagStories.FloatingStyles),
52+
onClick: () =>
53+
stackblitzPrefillConfig(DropdownFeatureflagStories.FloatingStyles),
4954
},
5055
]}
51-
/>
56+
/>

packages/react/src/components/Dropdown/Dropdown.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ export interface DropdownProps<ItemType>
104104
ariaLabel?: string;
105105

106106
/**
107-
* **Experimental**: Will attempt to automatically align the floating element to avoid collisions with the viewport and being clipped by ancestor elements.
107+
* **Experimental**: Will attempt to automatically align the floating element
108+
* to avoid collisions with the viewport and being clipped by ancestor
109+
* elements. Requires React v17+
110+
* @see https://github.com/carbon-design-system/carbon/issues/18714
108111
*/
109112
autoAlign?: boolean;
110113

@@ -745,7 +748,10 @@ Dropdown.propTypes = {
745748
),
746749

747750
/**
748-
* **Experimental**: Will attempt to automatically align the floating element to avoid collisions with the viewport and being clipped by ancestor elements.
751+
* **Experimental**: Will attempt to automatically align the floating element
752+
* to avoid collisions with the viewport and being clipped by ancestor
753+
* elements. Requires React v17+
754+
* @see https://github.com/carbon-design-system/carbon/issues/18714
749755
*/
750756
autoAlign: PropTypes.bool,
751757

0 commit comments

Comments
 (0)