Commit 9e9c08c
authored
* rework Tabs so that they don't change on focus
The "change on focus" was an incorrect implementation detail that made
it a bit easier but this causes a problem as seen in #1858.
If you want to conditionally check if you want to change the tab or note
(e.g. by using `window.confirm`) then the focus is lost while the popup
is shown. Regardless of your choice, the browser will re-focus the Tab
therefore asking you *again* what you want to do.
This fixes that by only activating the tab if needed while using arrow
keys or when you click the tab (not when it is focused).
* update changelog
1 parent e7cfb05 commit 9e9c08c
File tree
4 files changed
+44
-25
lines changed- packages
- @headlessui-react
- src/components/tabs
- @headlessui-vue
- src/components/tabs
4 files changed
+44
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
| 326 | + | |
325 | 327 | | |
326 | 328 | | |
327 | 329 | | |
| |||
336 | 338 | | |
337 | 339 | | |
338 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
339 | 351 | | |
340 | 352 | | |
341 | 353 | | |
| |||
353 | 365 | | |
354 | 366 | | |
355 | 367 | | |
356 | | - | |
| 368 | + | |
357 | 369 | | |
358 | 370 | | |
359 | 371 | | |
360 | 372 | | |
361 | 373 | | |
362 | 374 | | |
363 | | - | |
| 375 | + | |
364 | 376 | | |
365 | 377 | | |
366 | | - | |
367 | | - | |
| 378 | + | |
| 379 | + | |
368 | 380 | | |
369 | 381 | | |
370 | 382 | | |
371 | | - | |
| 383 | + | |
372 | 384 | | |
373 | 385 | | |
374 | 386 | | |
375 | 387 | | |
376 | | - | |
| 388 | + | |
377 | 389 | | |
378 | 390 | | |
379 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
380 | 394 | | |
381 | 395 | | |
382 | 396 | | |
383 | 397 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | 398 | | |
389 | 399 | | |
390 | 400 | | |
| |||
411 | 421 | | |
412 | 422 | | |
413 | 423 | | |
414 | | - | |
415 | 424 | | |
416 | 425 | | |
417 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
236 | 247 | | |
237 | 248 | | |
238 | 249 | | |
| |||
250 | 261 | | |
251 | 262 | | |
252 | 263 | | |
253 | | - | |
| 264 | + | |
254 | 265 | | |
255 | 266 | | |
256 | 267 | | |
257 | 268 | | |
258 | 269 | | |
259 | 270 | | |
260 | | - | |
| 271 | + | |
261 | 272 | | |
262 | 273 | | |
263 | | - | |
| 274 | + | |
264 | 275 | | |
265 | 276 | | |
266 | 277 | | |
267 | 278 | | |
268 | | - | |
| 279 | + | |
269 | 280 | | |
270 | 281 | | |
271 | 282 | | |
272 | 283 | | |
273 | 284 | | |
274 | | - | |
| 285 | + | |
275 | 286 | | |
276 | 287 | | |
277 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
278 | 291 | | |
279 | 292 | | |
280 | 293 | | |
281 | 294 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | 295 | | |
287 | 296 | | |
288 | 297 | | |
| |||
315 | 324 | | |
316 | 325 | | |
317 | 326 | | |
318 | | - | |
319 | 327 | | |
320 | 328 | | |
321 | 329 | | |
| |||
0 commit comments