Skip to content

Commit

Permalink
add datable typahead aria-expanded for first interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
John Carroll authored and John Carroll committed Mar 10, 2021
1 parent e0adbaf commit 23e7b06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fec/fec/static/js/modules/filters/filter-typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ FilterTypeahead.prototype.setFirstItem = function() {
$(this.$elm.find('.tt-suggestion')[0]).addClass('tt-cursor');
if (this.$elm.find('.tt-suggestion').length > 0) {
this.enableButton();
this.$field.attr('aria-expanded', 'true');
}
};

Expand All @@ -122,14 +123,14 @@ FilterTypeahead.prototype.handleAutocomplete = function(e, datum) {
};

FilterTypeahead.prototype.handleKeypress = function(e) {
this.handleChange();

if (this.$elm.find('.tt-suggestion').length > 0) {
this.$field.attr('aria-expanded', 'true');
} else {
this.$field.attr('aria-expanded', 'false');
}

this.handleChange();

if (e.keyCode === 13) {
this.handleSubmit(e);
}
Expand Down

0 comments on commit 23e7b06

Please sign in to comment.