mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-12 00:59:46 +00:00
fix(core): 🐛 inconsistent search focus behavior
This commit is contained in:
parent
6af0900185
commit
1aba52b870
|
@ -169,11 +169,11 @@ function renderSearchClearButton( input ) {
|
|||
input.focus();
|
||||
} );
|
||||
|
||||
input.addEventListener( 'input', ( event ) => {
|
||||
if ( event.target.value === '' ) {
|
||||
input.addEventListener( 'input', () => {
|
||||
if ( input.value === '' ) {
|
||||
clearButton.remove();
|
||||
} else {
|
||||
event.target.after( clearButton );
|
||||
input.after( clearButton );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
@ -204,13 +204,13 @@ function initSearch( window ) {
|
|||
if ( isPrimarySearch ) {
|
||||
const checkbox = document.getElementById( 'citizen-search__checkbox' );
|
||||
bindExpandOnSlash( window, checkbox, input );
|
||||
renderSearchClearButton( input );
|
||||
// Focus when toggled
|
||||
checkbox.addEventListener( 'input', () => {
|
||||
focusOnChecked( checkbox, input );
|
||||
} );
|
||||
}
|
||||
|
||||
renderSearchClearButton( input );
|
||||
setLoadingIndicatorListeners( searchBox, true, renderSearchLoadingIndicator );
|
||||
loadSearchModule( input, searchModule, () => {
|
||||
setLoadingIndicatorListeners( searchBox, false, renderSearchLoadingIndicator );
|
||||
|
|
Loading…
Reference in a new issue