Repository navigation
Commit f88f5dc
authored
fix(HoverCard): focusTrigger="auto" decides when focus arrives, through Tooltip's shared check (#9597)
* fix(HoverCard): focusTrigger="auto" decides when focus arrives, through Tooltip's shared check
component:HoverCard Current-state impact ("A roving trigger may not open on
focus"), architecture:interaction-modality INV4. useHoverCard read the tab
order only when its listeners attached, so a roving trigger rendered with
tabindex="-1" never opened on keyboard focus until a re-render, and a
focusable trigger the check does not list (<summary>, an SVG link) never did.
Tooltip already judges focus per event. That check moves to
utils/triggerFocus.ts (isFocusableTrigger, isFocusForTrigger) and both hooks
call it: focus listeners attach unless focusTrigger is "never", each focusin
is judged when it arrives, and a focus that counted still hides on blur
after the trigger left the tab order. Tooltip's behavior and tests are
unchanged. Tests: roving, <summary> (red before), plain wrapper, and
left-the-tab-order. Record: the Current-state bullet is dropped and the
FR4-FR6 row names the cases.
* fix(HoverCard, Tooltip): one shared focus gate, and the docs say auto judges focus when it arrives
CodeBunny on #9597:
- The counted-focus memory moves into utils/triggerFocus.ts as
createTriggerFocusGate (focusIn, focusOut); useTooltip and useHoverCard
each keep one gate and call it, with no local copy.
- HoverCard's record drops FR4's gap sentence for the behavior, the Focus
trigger row says it is judged when focus arrives, and the readiness count
drops to seven; useHoverCard.doc.mjs, HoverCard.doc.mjs (both languages)
and the focusTrigger JSDoc use Tooltip's wording.
- A new case covers focus inside a focusable trigger that leaves the tab
order, which needs the counted memory.
* Merge main into lane4/hovercard-focus-trigger-auto
* Merge commit '381c0d272a72a1a8ec810d3f711235094725f087' into lane4/hovercard-focus-trigger-auto
# Conflicts:
# docs/specs/components/HoverCard/HoverCard.spec.md
* Merge commit 'ae97fa8fc03702d3e60c6e8a4279d9f8e89314bb' into lane4/hovercard-focus-trigger-auto
# Conflicts:
# docs/specs/components/HoverCard/HoverCard.spec.md1 parent 275a3f8 commit f88f5dc
9 files changed
Lines changed: 463 additions & 172 deletions
File tree
- .changeset
- docs/specs/components/HoverCard
- packages/core/src
- HoverCard
- Tooltip
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
306 | | - | |
| 307 | + | |
| 308 | + | |
307 | 309 | | |
308 | 310 | | |
309 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 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 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
173 | 285 | | |
174 | 286 | | |
175 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| |||
0 commit comments