Skip to content

Commit

Permalink
fix(search): 馃悰 ensure that onFocus event are properly fired
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 committed Aug 4, 2023
1 parent 4a478ef commit 9921a00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion resources/skins.citizen.search/searchClients/mwActionApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ function adaptApiResponse( config, query, response, showDescription ) {

// Sometimes there can be multiple redirect object for the same page, only take the one with lower index
if ( response.pages.length !== pageCount ) {
response.pages = response.pages.filter( ( obj ) => { return obj.hasOwnProperty( 'title' ); } );
response.pages = response.pages.filter( ( obj ) => {
return Object.prototype.hasOwnProperty.call( obj, 'title' );
} );
}
}

Expand Down
6 changes: 3 additions & 3 deletions resources/skins.citizen.search/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const typeahead = {
updateTypeahead();
typeahead.form.element.parentElement.classList.add( 'citizen-search__card--expanded' );
typeahead.input.element.addEventListener( 'keydown', keyboardEvents );
typeahead.input.element.addEventListener( 'input', this.onInput );
typeahead.input.element.addEventListener( 'compositionstart', this.onCompositionstart );
typeahead.input.element.addEventListener( 'compositionend', this.onCompositionend );
typeahead.input.element.addEventListener( 'input', typeahead.input.onInput );
typeahead.input.element.addEventListener( 'compositionstart', typeahead.input.onCompositionstart );
typeahead.input.element.addEventListener( 'compositionend', typeahead.input.onCompositionend );
typeahead.input.element.addEventListener( 'blur', typeahead.onBlur );
},
onInput: function () {
Expand Down

0 comments on commit 9921a00

Please sign in to comment.