Use type="search" for search input fields

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/768

So that the input fields can gain extra built-in
browser widgets useful in search fields.
This commit is contained in:
Raymond Hill 2019-11-03 13:14:29 -05:00
parent 3dc0686ba5
commit da253bf80c
No known key found for this signature in database
GPG key ID: 25E1490B761470C2
4 changed files with 8 additions and 13 deletions

View file

@ -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;
}

View file

@ -32,7 +32,7 @@
<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>

View file

@ -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;
}
@ -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>' +

View file

@ -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>