|
376 | 376 | lookupTimer = setTimeout(clearLookupContext, 850); |
377 | 377 | } |
378 | 378 |
|
379 | | - function lookup(key, isBackward) { |
| 379 | + function lookup(container, key, isBackward) { |
380 | 380 | key = key.toLowerCase(); |
381 | 381 |
|
382 | 382 | var currentLookupStartA; |
383 | 383 | if (key === lookupKey) { |
384 | 384 | // same as last key, lookup next for the same key as prefix |
385 | | - currentLookupStartA = itemList.querySelector(':focus'); |
| 385 | + currentLookupStartA = container.querySelector(':focus'); |
386 | 386 | } else { |
387 | 387 | if (!lookupStartA) { |
388 | | - lookupStartA = itemList.querySelector(':focus'); |
| 388 | + lookupStartA = container.querySelector(':focus'); |
389 | 389 | } |
390 | 390 | currentLookupStartA = lookupStartA; |
391 | 391 | if (lookupKey === undefined) { |
|
397 | 397 | lookupBuffer += key; |
398 | 398 | } |
399 | 399 | delayClearLookupContext(); |
400 | | - return getMatchedFocusableSibling(itemList, isBackward, currentLookupStartA, lookupKey || lookupBuffer); |
| 400 | + return getMatchedFocusableSibling(container, isBackward, currentLookupStartA, lookupKey || lookupBuffer); |
401 | 401 | } |
402 | 402 |
|
403 | 403 | var canArrowMove; |
|
457 | 457 | } |
458 | 458 | } |
459 | 459 | if (!e.ctrlKey && (!e.altKey || IS_MAC_PLATFORM) && !e.metaKey && e.key.length === 1) { |
460 | | - return lookup(e.key, e.shiftKey); |
| 460 | + return lookup(itemList, e.key, e.shiftKey); |
461 | 461 | } |
462 | 462 | } else if (e.keyCode) { |
463 | 463 | if (canArrowMove(e)) { |
|
489 | 489 | } |
490 | 490 | } |
491 | 491 | if (!e.ctrlKey && (!e.altKey || IS_MAC_PLATFORM) && !e.metaKey && e.keyCode >= 32 && e.keyCode <= 126) { |
492 | | - return lookup(String.fromCharCode(e.keyCode), e.shiftKey); |
| 492 | + return lookup(itemList, String.fromCharCode(e.keyCode), e.shiftKey); |
493 | 493 | } |
494 | 494 | } |
495 | 495 | } |
|
0 commit comments