Commit 1a145fd
authored
* remove `forceRerender` code
This was necessary to ensure the `Panel` and the `Tab` were properly
connected with eachother because it could happen that the `Tab` renders
but the corresponding `Panel` is not the active one which means that it
didn't have a DOM node and no `id` attached.
Whenever new `Tab` became active, it rerendered but the `Panel` wasn't
available yet, after that the `Panel` rendered and an `id` was available
but the actual `Tab` was already rendered so there was no link between
them.
We then forced a re-render because now the `Panel` does have a DOM node
ref attached and the `aria-labelledby` could be filled in.
However, in #1837 we fixed an issue where the order of `Tab` elements
with their corresponding `Panel` elements weren't always correct. To fix
this we ensured that the `Panel` always rendered a `<Hidden />`
component which means that a DOM node is always available.
This now means that we can get rid of the `forceRerender`.
* update changelog
1 parent 46a7ab6 commit 1a145fd
File tree
3 files changed
+53
-18
lines changed- packages/@headlessui-react
- src/components/tabs
3 files changed
+53
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
171 | 221 | | |
172 | 222 | | |
173 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| |||
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
57 | | - | |
58 | 55 | | |
59 | 56 | | |
60 | 57 | | |
| |||
110 | 107 | | |
111 | 108 | | |
112 | 109 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | 110 | | |
117 | 111 | | |
118 | 112 | | |
| |||
154 | 148 | | |
155 | 149 | | |
156 | 150 | | |
157 | | - | |
158 | 151 | | |
159 | 152 | | |
160 | 153 | | |
| |||
229 | 222 | | |
230 | 223 | | |
231 | 224 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | 225 | | |
236 | 226 | | |
237 | 227 | | |
| |||
335 | 325 | | |
336 | 326 | | |
337 | 327 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
| 328 | + | |
342 | 329 | | |
343 | 330 | | |
344 | 331 | | |
| |||
492 | 479 | | |
493 | 480 | | |
494 | 481 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
| 482 | + | |
499 | 483 | | |
500 | 484 | | |
501 | 485 | | |
| |||
0 commit comments