Why is selected text in the Twitter search box not highlighted?
Selected text in the Twitter search box is not highlighted. It should be highlighted. So far as I've noticed, this is the only place where my system doesn't highlight text properly. I can't find any references to this problem with the Twitter search text highlighting anywhere from anyone other than me.
I'm using Firefox 12 on Windows XP Home with the XP classic theme.
Image http://i528.photobucket.com/albums/dd329/Sharcel-Bellic/Twittersearchbox.png The word "This" in the above image should be highlighted.
Toate răspunsurile (2)
I also see this in Firefox 13 beta 7 on Windows 7 with a "Basic" theme. The selected text is a different color, but you can't see any contrasting background.
I think it's related to the interaction of some style rules in the page. The search box background-color is set to be "transparent". Firefox is computing the background color based on the dark header bar (.global-nav) and therefore using too light a highlight color. I'm not sure who's "at fault" here, but I can see two workarounds. (Note that I was not logged in to Twitter when testing this.)
(1) Set the search box to have a white background. To see what I mean, you could try this experiment.
While viewing Twitter, press Ctrl+Shift+k to drop down the web console. Next to the > caret, paste the following (it's all one line) and press Enter:
document.getElementById("search-query").style.backgroundColor = "white";
The background of the search box now should stay white whether your cursor is in the box or not, and the selection should be visible.
Of course, it's not practical to do that any time you want to see your selection. You can enforce site-specific style changes by creating a rule for twitter.com in the Stylish add-on.
Oh, and to close the web console, press Ctrl+Shift+k again.
(2) Give the dark nav bar a white background (it still will appear dark because there is an image that shows on top of the background color).
document.querySelector("div.global-nav").style.backgroundColor = "white";
Et cetera.
Hopefully Twitter will address this, or will file a bug with Mozilla to change what Firefox does. I haven't searched whether such a bug has already been filed.
Such issues have been reported as caused by a PNG image with a white color for the background.
A right-click on that search bar and opening the Inspector and disable the .global-nav .form-search .search-input { []background-color: transparent;} rule also makes this work.
This works only as long as the search bar has focus.
Not sure which rule is causing the selection not to work if the focus is removed.
Modificat la