You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ca3591e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/6.x/docs/guides/migration.md
+33-55Lines changed: 33 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,61 +71,41 @@ You can use the component's color prop where available, or override the correspo
71
71
72
72
### Test IDs
73
73
74
-
Hardcoded default test IDs have been removed for the components listed below. Many of these components also derive test IDs for their internal parts by appending a suffix to the `testID` prop (e.g. `${testID}-container`). Since `testID` is no longer defaulted to a hardcoded value, none of these derived test IDs are set either unless you pass a `testID` explicitly — so all queries by the IDs below will stop matching:
74
+
Hardcoded default test IDs have been removed for the components listed below:
-`icon-button-icon` (and `icon-button-icon-previous` / `icon-button-icon-current` when `animated`)
107
88
-`Menu`: `menu`
108
-
-`menu-view`
109
-
-`menu-surface`
110
89
-`Menu.Item`: `menu-item`
111
-
-`menu-item-title`
112
90
-`Modal`: `modal`
113
-
-`modal-backdrop`
114
-
-`modal-wrapper`
115
-
-`modal-surface`
116
91
-`ProgressBar`: `progress-bar`
117
-
-`progress-bar-fill`
118
92
-`Searchbar`: `search-bar`
119
-
-`search-bar-container`
120
-
-`search-bar-icon`
121
-
-`search-bar-icon-wrapper`
122
-
-`search-bar-clear-icon`
123
-
-`search-bar-trailering-icon`
124
-
-`search-bar-divider`
125
93
-`Surface`: `surface`
126
-
-`surface-outer-layer`
127
94
128
-
You can specify a `testID` explicitly to restore both the component's own test ID and all of its derived test IDs above, using the same suffixes.
95
+
You can specify a `testID` explicitly to restore each component's own test ID.
96
+
97
+
These components used to also derive test IDs for internal, implementation-only elements by appending a suffix to the `testID` prop (e.g. `${testID}-container`, `${testID}-icon`, `${testID}-outline`). They have been removed entirely.
98
+
99
+
If you were relying on internal test IDs, update your tests not to rely on internal implementation details and only interact with elements or assert content your users can reach, e.g.: query by role, label, text etc., or `testID` props accepted by the component.
100
+
101
+
Some components now accept explicit `testID` props for their interactable elements:
102
+
103
+
-`BottomNavigation`: `barTestID` for the internal `BottomNavigation.Bar`, replacing the previous `${testID}-bar` derivation.
104
+
-`Chip`: `closeIconTestID` for the close icon button.
105
+
-`Dialog` and `Modal`: `overlayTestID` for the overlay displayed behind the content.
106
+
-`Menu`: `overlayTestID` for the overlay displayed behind the menu.
107
+
-`Searchbar`: `searchTestID`, `clearTestID`, and `trailingTestID` for the search, clear, and trailing icon buttons.
108
+
-`Snackbar`: `iconTestID` for the icon button.
129
109
130
110
## Components
131
111
@@ -208,6 +188,24 @@ e.g.:
208
188
- The default elevation changed from level `1` to level `3`.
209
189
- The `style` prop no longer configures the background color or border radius. You can override `theme.colors.surfaceContainerHigh` and `theme.shapes.corner.extraLarge` using the `theme` prop instead.
210
190
191
+
#### `Dialog.Actions`
192
+
193
+
`Dialog.Actions` no longer forces `compact` and `uppercase` on its buttons. Set them on the buttons if you want the old look.
194
+
195
+
```tsx
196
+
// Before (v5)
197
+
<Dialog.Actions>
198
+
<ButtononPress={hide}>Done</Button>
199
+
</Dialog.Actions>
200
+
201
+
// After (v6)
202
+
<Dialog.Actions>
203
+
<ButtoncompactuppercaseonPress={hide}>
204
+
Done
205
+
</Button>
206
+
</Dialog.Actions>
207
+
```
208
+
211
209
### TextInput
212
210
213
211
The Paper 6.x `TextInput` is a complete rewrite with a new API. Import the component the same way, but note that the props and behavior have changed significantly.
@@ -353,26 +351,6 @@ const theme = {
353
351
354
352
`Card.Content` now has 16dp of padding on every side. It used to drop its top or bottom padding when it sat next to a `Card.Cover` or `Card.Title`, so cards that mix those sections grow a little taller. Pass `style` if you want the tighter spacing back.
355
353
356
-
### Dialog
357
-
358
-
#### `Dialog.Actions`
359
-
360
-
`Dialog.Actions` no longer forces `compact` and `uppercase` on its buttons. Set them on the buttons if you want the old look.
0 commit comments