Commit aac7449
authored
fix(ui5-split-button): fire click event when focused with shift + tab (#11197)
### Main Problem
There was an issue, where if the `ui5-split-button` was to be focused by using `Shift + Tab` combination, the `click` event wasn't firing, after the first time a default action was executed (pressed `Enter` or `Space`).
The reason behind this, was a flag called `_shiftOrEscapePressed`.
Since the component has a handler for `focus-in` event which was just early returning if the component `matches` the `:focus-within` CSS selector, which was causing the flag to NOT reset. Therefore the component wasn't firing `click` event, due to the condition:
```ts
_fireClick(e?: Event) {
e?.stopPropagation();
if (!this._shiftOrEscapePressed) {
this.fireDecoratorEvent("click");
}
this._shiftOrEscapePressed = false;
}
```
### Solutions
- We solved few issues, by introducing a new flag called `_shiftOrEscapePressedDuringSpace`, which handles the cases only when `Shift` or `Escape` keys are pressed simultaneously with the `Space` Bar.
- Deleted an unused forgotten flag;
- Handled an issue where the arrow button was being 'frozen' if simultaneously pressing `ArrowUp/Down` keys and `Tab/Shift + Tab`.
- `Shift/Escape` keys now correctly prevent events from firing;
- Fixed a bug where `arrow-button` fired `click` **AND** `arrow-click` events.1 parent 0b3a47b commit aac7449
2 files changed
+45
-77
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 173 | + | |
182 | 174 | | |
183 | 175 | | |
184 | 176 | | |
| |||
227 | 219 | | |
228 | 220 | | |
229 | 221 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | 222 | | |
234 | 223 | | |
235 | 224 | | |
| |||
248 | 237 | | |
249 | 238 | | |
250 | 239 | | |
251 | | - | |
| 240 | + | |
252 | 241 | | |
253 | 242 | | |
254 | 243 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | 244 | | |
263 | 245 | | |
264 | 246 | | |
| |||
273 | 255 | | |
274 | 256 | | |
275 | 257 | | |
276 | | - | |
277 | 258 | | |
278 | 259 | | |
279 | 260 | | |
280 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
281 | 265 | | |
282 | | - | |
| 266 | + | |
283 | 267 | | |
284 | 268 | | |
285 | | - | |
286 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
287 | 272 | | |
288 | 273 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
| 274 | + | |
| 275 | + | |
293 | 276 | | |
294 | 277 | | |
295 | 278 | | |
296 | 279 | | |
297 | 280 | | |
298 | 281 | | |
299 | | - | |
| 282 | + | |
300 | 283 | | |
301 | 284 | | |
302 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
303 | 292 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 293 | + | |
310 | 294 | | |
311 | | - | |
312 | | - | |
313 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
314 | 299 | | |
315 | 300 | | |
316 | | - | |
317 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
318 | 305 | | |
| 306 | + | |
319 | 307 | | |
320 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
321 | 312 | | |
322 | 313 | | |
323 | 314 | | |
324 | 315 | | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 316 | + | |
329 | 317 | | |
330 | 318 | | |
331 | 319 | | |
| |||
383 | 371 | | |
384 | 372 | | |
385 | 373 | | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | 374 | | |
396 | 375 | | |
397 | 376 | | |
| |||
401 | 380 | | |
402 | 381 | | |
403 | 382 | | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | 383 | | |
409 | 384 | | |
410 | 385 | | |
| |||
414 | 389 | | |
415 | 390 | | |
416 | 391 | | |
417 | | - | |
418 | 392 | | |
419 | 393 | | |
420 | 394 | | |
421 | 395 | | |
422 | 396 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
| 397 | + | |
434 | 398 | | |
435 | | - | |
436 | 399 | | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
441 | 410 | | |
442 | 411 | | |
443 | 412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
0 commit comments