Not all search matches are highlighted
Categories
(DevTools :: Netmonitor, defect, P2)
Tracking
(firefox71 fixed)
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: Honza, Assigned: lalas)
References
Details
Attachments
(2 files)
It looks like that not all search matches are highlighted in the Search panel. See the attached screenshot
- Only the first two search results have highlighted the search-keyword
- The fourth and fifth results don't highlighted anything
- The third result is there because match was with the Cookie name also not highlighted.
Honza
Reporter | ||
Comment 1•5 years ago
|
||
@Lloan, could you please look at this one?
Honza
Reporter | ||
Comment 2•5 years ago
|
||
It somehow relates to the fact the the search-string is at the begginning of a cookie (or header) value.
So, the start index is 0
, which if used in a condition might be resulting with false
even if it's
valid index. Or something like that...
I found this place. Fixing that helps, but not sure if it's the only place...
diff --git a/devtools/client/netmonitor/src/components/search/SearchPanel.js b/devtools/client/netmonitor/src/compo--- a/devtools/client/netmonitor/src/components/search/SearchPanel.js
+++ b/devtools/client/netmonitor/src/components/search/SearchPanel.js
@@ -163,17 +163,17 @@ class SearchPanel extends Component {
}
const indexStart = caseSensitive
? object.value.indexOf(query)
: object.value.toLowerCase().indexOf(query.toLowerCase());
const indexEnd = indexStart + query.length;
// Handles a match in a string
- if (indexStart > 0) {
+ if (indexStart >= 0) {
return span(
{ title: object.value },
span({}, object.value.substring(0, indexStart)),
span(
{ className: "query-match" },
object.value.substring(indexStart, indexStart + query.length)
),
span({}, object.value.substring(indexEnd, object.value.length))
Honza
Assignee | ||
Comment 3•5 years ago
|
||
Honza,
That should be the only place. I see the error now - its not taking in to account when the index starts at 0. I'll create a patch for this - thanks!
Assignee | ||
Comment 4•5 years ago
|
||
Reporter | ||
Comment 5•5 years ago
|
||
Check out the following match at the screenshot:
MyCustomCookie: Workers+eat+cookies
The Workers
part isn't highlighted.
Honza
Reporter | ||
Updated•5 years ago
|
Pushed by jodvarko@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1e329466ec57 Not all search matches are highlighted. r=Honza
Comment 7•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•