Skip to content

Commit

Permalink
fix(core): 馃悰 enter key should not clear search input
Browse files Browse the repository at this point in the history
Use span instead of button element. As button element will make
enter key triggering the clear button.
  • Loading branch information
alistair3149 committed Jul 16, 2023
1 parent 4cf9417 commit 739fa85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/skins.citizen.scripts/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ function bindExpandOnSlash( window, checkbox, input ) {
*/
function renderSearchClearButton( input ) {
const
clearButton = document.createElement( 'button' ),
clearButton = document.createElement( 'span' ),
clearIcon = document.createElement( 'span' );

clearButton.classList.add( 'citizen-search__clear', 'citizen-search__formButton', 'citizen-button' );
clearButton.classList.add( 'citizen-search__clear', 'citizen-search__formButton' );
clearIcon.classList.add( 'citizen-ui-icon', 'mw-ui-icon-wikimedia-clear' );
clearButton.append( clearIcon );

Expand Down
1 change: 1 addition & 0 deletions resources/skins.citizen.styles/components/Search.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

&__formButton {
border-radius: var( --border-radius--small );
cursor: pointer;

.citizen-ui-icon::before {
transition: var( --transition-hover );
Expand Down

0 comments on commit 739fa85

Please sign in to comment.