|
281 | 281 | this.taggerSuggestionsButton = $('<div>')
|
282 | 282 | .addClass('droparrow')
|
283 | 283 | .addClass('hittarget')
|
284 |
| - .attr('aria-label', 'Toggle option display') |
285 |
| - .attr('role', 'button') |
286 | 284 | .bind('mouseup keyup', $.proxy(this._handleSuggestionsButtonInteraction, this))
|
287 | 285 | .appendTo(this.taggerButtonsPanel);
|
288 | 286 | $('<img>')
|
|
303 | 301 | .appendTo(this.taggerSuggestionsButton);
|
304 | 302 | }
|
305 | 303 |
|
306 |
| - this.taggerSuggestionsButton.attr("tabindex", this.tabIndex); |
307 |
| - |
308 | 304 | // Add placeholder text to text input field
|
309 | 305 | if (this.options.placeholder !== null) {
|
310 | 306 | this.taggerInput.attr("placeholder", this.options.placeholder);
|
|
325 | 321 | // Select the widget itself again
|
326 | 322 | this._getWidgetFocusable().focus();
|
327 | 323 | }
|
| 324 | + |
| 325 | + if (event.target && event.altKey && (event.which === this.keyCodes.DOWN || event.which === this.keyCodes.UP)) { |
| 326 | + this._toggleShowSuggestions(); |
| 327 | + |
| 328 | + // Select the widget itself again |
| 329 | + this._getWidgetFocusable().focus(); |
| 330 | + } |
328 | 331 | }, this));
|
329 | 332 |
|
330 | 333 | // Capture the keypress event for any child elements - redirect any chars to the current input field
|
|
574 | 577 | }
|
575 | 578 | }
|
576 | 579 | else if (event.which === this.keyCodes.DOWN) { // Down Arrow
|
577 |
| - if (isMainInput) { |
| 580 | + if (isMainInput && !event.altKey) { |
578 | 581 | if (!this.options.ajaxURL || this.taggerSuggestions.is(":visible")) {
|
579 | 582 | this._showSuggestions(true);
|
580 | 583 | }
|
|
613 | 616 | this.taggerWidget.find("input[tabindex]:visible").first().focus();
|
614 | 617 | }
|
615 | 618 | else {
|
616 |
| - // If the suggestion list is visible already, then toggle it off |
617 |
| - if (this.taggerSuggestions.is(":visible")) { |
618 |
| - this._hideSuggestions(); |
619 |
| - } |
620 |
| - // otherwise show it |
621 |
| - else { |
622 |
| - this._showSuggestions(true); |
623 |
| - } |
| 619 | + this._toggleShowSuggestions(); |
624 | 620 | }
|
625 | 621 | event.preventDefault();
|
626 | 622 | }
|
627 | 623 | },
|
628 | 624 |
|
| 625 | + /** |
| 626 | + * Toggle whether suggestions are shown or not |
| 627 | + * |
| 628 | + * @private |
| 629 | + */ |
| 630 | + _toggleShowSuggestions: function() { |
| 631 | + // If the suggestion list is visible already, then toggle it off |
| 632 | + if (this.taggerSuggestions.is(":visible")) { |
| 633 | + this._hideSuggestions(); |
| 634 | + } |
| 635 | + // otherwise show it |
| 636 | + else { |
| 637 | + this._showSuggestions(true); |
| 638 | + } |
| 639 | + }, |
| 640 | + |
629 | 641 | /**
|
630 | 642 | * When keypress events fire on the tagger widget redirect them to the filter input
|
631 | 643 | *
|
|
0 commit comments