From da253bf80c59167452e65589a22c644539d55eca Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 3 Nov 2019 13:14:29 -0500 Subject: [PATCH] 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. --- src/css/logger-ui.css | 11 +++-------- src/dyna-rules.html | 2 +- src/js/codemirror/search.js | 6 +++--- src/logger-ui.html | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/css/logger-ui.css b/src/css/logger-ui.css index 3df70a861..470081699 100644 --- a/src/css/logger-ui.css +++ b/src/css/logger-ui.css @@ -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; } diff --git a/src/dyna-rules.html b/src/dyna-rules.html index 12353f354..ab70007a7 100644 --- a/src/dyna-rules.html +++ b/src/dyna-rules.html @@ -32,7 +32,7 @@ -
+
diff --git a/src/js/codemirror/search.js b/src/js/codemirror/search.js index d21bd4c6d..248249170 100644 --- a/src/js/codemirror/search.js +++ b/src/js/codemirror/search.js @@ -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 @@ '
' + 'search ' + '' + - '' + + '' + '' + '0' + '' + diff --git a/src/logger-ui.html b/src/logger-ui.html index 657b0926a..36fabf235 100644 --- a/src/logger-ui.html +++ b/src/logger-ui.html @@ -54,7 +54,7 @@ filter - + angle-up