Commit 8925d30
feat: add setTabFocusEnabled API to Popover (#9208)
## Summary
Related to vaadin/web-components#11423
- Adds `Popover#setTabFocusEnabled(boolean)` / `isTabFocusEnabled()` to
the Flow wrapper, mapping to the web component's `noTabFocus` property
in positive form (default `true`, matching the web component's default
of `noTabFocus = false`).
- When set to `false`, pressing Tab on the target/sibling skips past the
popover and Shift+Tab does not move focus into the popover's last
focusable. Has no effect on modal popovers (which use their own focus
trap), as documented in the Javadoc.
- Mirrors the existing inverted-boolean pattern used for `setCloseOnEsc`
/ `setCloseOnOutsideClick`.
## Test plan
- [x] Unit test `PopoverTest#setTabFocusEnabled_isTabFocusEnabled`
covers the default state and toggling in both directions, asserting both
the public getter and the underlying `noTabFocus` element property.
- [x] `mvn spotless:apply` clean.
- [x] `mvn test -pl vaadin-popover-flow-parent/vaadin-popover-flow
-Dtest='PopoverTest'` passes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b88af58 commit 8925d30
2 files changed
Lines changed: 53 additions & 0 deletions
File tree
- vaadin-popover-flow-parent/vaadin-popover-flow/src
- main/java/com/vaadin/flow/component/popover
- test/java/com/vaadin/flow/component/popover
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
346 | 382 | | |
347 | 383 | | |
348 | 384 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
324 | 341 | | |
325 | 342 | | |
326 | 343 | | |
| |||
0 commit comments