quirk in search field where it goes blank when I click somewhere else

I have a search field and it has this quirk that I can not figure out. I type in some words into the search field and hit the return key to perform the search. The search field is linked to the ‘keyboard up’ handler, so as the user types in the search words I have the keyboard up handler do nothing until it detects a return key… then my search takes place (I’m not sure if that’s relevant but just in case).

Everything works fine, but here’s the quirk. After a search the search words are still showing in the search field, I can visibly see them… which is how it should act. But as soon as I click somewhere else and remove focus from the search field the search words disappear. I can no longer visibly see them. The search words really are still there because I can click back in the search field and they reappear, but when I’m clicked on something else they’re gone?

Does that make sense??? No where in my code do I enable or disable anything so that’s not a cause. I have my search field set to first responder of the window so the focus stays there, but I disabled that line and the problem persists… so that’s not the cause. I even disabled the entire code I have for the ‘key up’ handler and the problem persists so it’s nothing in there either. I can’t track this down.

Any ideas why my search words disappear from view when the search field is not the focus?

Never mind!!!

I solved it. This is strange but I was playing with the look of my app, so I tried changing the background color of the search field. I changed it from white to a darker color in interface builder. It had no effect… at least I thought. Visibly the background color never changed, it always stayed white no matter what color I chose so I just moved on to something else and never changed the color back to white. But changing the color did have an effect. It had the effect of hiding my search words when the box was not in focus. So unbelievably that’s the effect of changing the background color on a search field. As soon as I changed the background color back to white everything worked as I expected. I can’t believe that one! :rolleyes: