<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Web Inspector: search shortcut in split console moves focus to search box, but doesn't show caret"
href="https://bugs.webkit.org/show_bug.cgi?id=149223#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Web Inspector: search shortcut in split console moves focus to search box, but doesn't show caret"
href="https://bugs.webkit.org/show_bug.cgi?id=149223">bug 149223</a>
from <span class="vcard"><a class="email" href="mailto:joepeck@webkit.org" title="Joseph Pecoraro <joepeck@webkit.org>"> <span class="fn">Joseph Pecoraro</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=261819&action=diff" name="attach_261819" title="patch">attachment 261819</a> <a href="attachment.cgi?id=261819&action=edit" title="patch">[details]</a></span>
patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=261819&action=review">https://bugs.webkit.org/attachment.cgi?id=261819&action=review</a>
r- just to see a new version of the patch.
<span class="quote">> Source/WebInspectorUI/ChangeLog:9
> + When pressing console find shortcut (CMD+F) SearchBar now checks if there's text on _searchInput
> + if so text is selected, if the textbox is empty, textbox gains focus</span >
Nit: End in a period.
<span class="quote">> Source/WebInspectorUI/ChangeLog:150
> - is selected and not updating focused element.
> + is selected and not updating focused element.</span >
You should drop all the whitespace changes below your additions at the top.
<span class="quote">> Source/WebInspectorUI/UserInterface/Views/SearchBar.js:64
> + if (this._searchInput.value.length == 0)</span >
Style: We use `===` where possible, but in the case of 0 we would just use `!`. E.g. "if (!this._searchInput.value.length)"
<span class="quote">> Source/WebInspectorUI/UserInterface/Views/SearchBar.js:67
> + this._searchInput.focus();
> + else
> + this._searchInput.select();</span >
So it turns out that this is an engine bug. Calling select in this case should show the caret and isn't.
I'd prefer if there was a comment here that we are working around a WebKit bug. I filed one, so you can add:
// FIXME: Workaround for: <<a href="https://webkit.org/b/149504">https://webkit.org/b/149504</a>> Caret missing from <input> after clearing text and calling select()</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>