Skip to content

Commit

Permalink
Use type="search" for search input fields
Browse files Browse the repository at this point in the history
Related issue:
- uBlockOrigin/uBlock-issues#768

So that the input fields can gain extra built-in
browser widgets useful in search fields.
  • Loading branch information
gorhill committed Nov 3, 2019
1 parent 3dc0686 commit da253bf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
11 changes: 3 additions & 8 deletions src/css/logger-ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,16 @@ body[dir="rtl"] #pageSelector {
opacity: 1;
}
#netInspector #filterInput {
border: 1px solid gray;
display: inline-flex;
}
#netInspector #filterInput > input {
min-width: 18em;
border: 0;
min-width: 16em;
}
#netInspector #filterExprButton {
position: absolute;
transform: scaleY(-1);
}
body[dir="ltr"] #netInspector #filterExprButton {
right: 0;
}
body[dir="rtl"] #netInspector #filterExprButton {
left: 0;
}
#netInspector #filterExprButton:hover {
background-color: transparent;
}
Expand Down
2 changes: 1 addition & 1 deletion src/dyna-rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h3 data-i18n="rulesTemporaryHeader"></h3>
<button type="button" class="custom iconifiable" id="importButton"><span class="fa">&#xf019;</span><span data-i18n="rulesImport"></span></button>
<button type="button" class="custom iconifiable important disabled" id="editSaveButton"><span class="fa">&#xf0c7;</span><span data-i18n="rulesEditSave"></span></button>
</div>
<div id="ruleFilter"><span class="fa">&#xf0b0;</span>&ensp;<input type="text" size="20"></div>
<div id="ruleFilter"><span class="fa">&#xf0b0;</span>&ensp;<input type="search" size="20"></div>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/js/codemirror/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@
}

function queryTextFromSearchWidget(cm) {
return getSearchState(cm).widget.querySelector('input[type="text"]').value;
return getSearchState(cm).widget.querySelector('input[type="search"]').value;
}

function queryTextToSearchWidget(cm, q) {
var input = getSearchState(cm).widget.querySelector('input[type="text"]');
var input = getSearchState(cm).widget.querySelector('input[type="search"]');
if ( typeof q === 'string' && q !== input.value ) {
input.value = q;
}
Expand Down Expand Up @@ -310,7 +310,7 @@
'<div class="cm-search-widget">' +
'<span class="fa-icon fa-icon-ro">search</span>&ensp;' +
'<span class="cm-search-widget-input">' +
'<input type="text">' +
'<input type="search">' +
'<span class="cm-search-widget-count">' +
'<span><!-- future use --></span><span>0</span>' +
'</span>' +
Expand Down
2 changes: 1 addition & 1 deletion src/logger-ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<span id="filterExprGroup">
<span id="filterButton" class="button fa-icon" data-i18n-title="loggerRowFiltererButtonTip">filter</span>
<span id="filterInput">
<input type="text" placeholder="logFilterPrompt">
<input type="search" placeholder="logFilterPrompt">
<span id="filterExprButton" class="button fa-icon expanded" data-i18n-title="loggerRowFiltererBuiltinTip">angle-up</span>
<div id="filterExprPicker">
<div><span data-filtex="!" data-i18n="loggerRowFiltererBuiltinNot"></span><span data-filtex="\t--\t|\t<<\t|\t##" data-i18n="loggerRowFiltererBuiltinBlocked"></span><span data-filtex="\t\+\+\t|\t\*\*\t|\t#@#" data-i18n="loggerRowFiltererBuiltinAllowed"></span></div>
Expand Down

0 comments on commit da253bf

Please sign in to comment.