Here are some more comments that may help with understanding and debugging what’s happening.
The updating of the ‘In selection’ area seems to happen well after the Find/replace dialog box is painted.
In step one where the cursor is in a blank area of the file and no text is selected do Ctrl-H and watch the ‘In selection’ area. If it shows a black box and ‘In selection’ in black then press Esc and then Ctrl-H again while continuing to watch the ‘In selection’ area. Eventually you will see black box and ‘In selection’ in black pop up and then quickly change to gray. It looks like the words ‘In selection’ go gray first and then the box.
Once you have a gray box and ‘In selection’ then press Esc to close the dialog box and select some text. The size of the selected area does not matter. It can be one character or the entire file. The method of selection does not seem to matter. You can use the mouse or keyboard. Now do Ctrl-H. You will see that ‘In selection’ and its box are grayed out. This is the random grayness people have been seeing. Press Esc to close the dialog box and Ctrl-H again while watching where ‘In selection’ will be painted. You should see the ‘In selection’ box being painted in black shortly after the dialog box has been opened. It’s possible both the box and the words ‘In selection’ were in gray but on my machine the repainting to black is too fast for me to confirm it’s all gray and then repainted. I am seeing the black box painted after the dialog box is up.
Also, while I have been switching to the ‘Find’ tab and back to ‘Replace’ to fix an undesired grayed out ‘In selection’ I found that it does not matter which tab of the dialog box you use. You can switch to ‘Find in Files’, which does not have an ‘In selection’ field and back or you can switch to ‘Mark’ and back. When switching to ‘Find’ and ‘Mark’ you’ll see that ‘In selection’ is in black.
This issue can also be reproduced using Ctrl-F for Find or Ctrl-M for Mark. The buggy behavior with the grayed ‘In selection’ is the same as with using Ctrl-H for Replace.