Mac OS X 10.5 (Leopard): No horizontal scrolling in search field in Preview

Posted by Pierre Igot in: Macintosh
January 3rd, 2008 • 4:10 pm

The new version of Preview (4.0) in Leopard has changed a lot. Most of the changes are improvements. Predictably, however, the new version has a number of annoying bugs.

In Preview 4.0, the behaviour of the search field has changed in that, by default, Preview now searches for individual keywords rather than exact phrases. If you want to search for an exact phrase, you have to put it between quotation marks—a new feature in Spotlight in Mac OS X 10.5 that was not available in 10.4.

This is all well and good, but sometimes the exact phrase I am looking for can be quite long. So I typically cut it from some other text editing application and paste it into the search field.

Unfortunately, the search field in Preview 4.0 suffers from one pretty obvious flaw: it has a maximum width, and if the length of the searched text exceeds that width, then Preview cannot display it in full:

Preview search field full

And when this happens, there is simply no way to display the rightmost portion of the searched text, i.e. the portion that is hidden because the search field is not wide enough.

Normally, in such a situation, in Mac OS X, you can use the cursor keys or the mouse to force the system to scroll horizontally to the right or to the left to reveal the hidden part. It could be called “scrolling without scroll bars,” because in this situation the context is too small to actually display a horizontal scroll bar to reflect the fact that the width of the content exceeds the width of the container.

Unfortunately, this “scrolling without scroll bars” feature is simply not supported in Preview 4.0’s search field, and that’s rather problematic. It’s obviously a bug, and one that a minimum of real-world testing with Preview should have revealed to Apple’s engineers. Not all search requests can be made short enough to fit in a field with a specific width!


3 Responses to “Mac OS X 10.5 (Leopard): No horizontal scrolling in search field in Preview”

  1. ssp says:

    I assume that this is embarrassing and suggests the Preview people carelessly fiddled with the standard find field.

    If you care for a silly ‘workaround’, try the following: Make the Preview window so narrow that the find field disappears from the toolbar. Then hit command F. A sheet with a narrow but non-broken find field will come up.

    Downside of this: Said sheet is so poorly programmed, that you start cursing the people who implemented it as well…

  2. Steve Nygard says:

    It appears to be a simple problem. By default, an NSSearchField is not scrollable. This seems like a poor choice, but they just need to make it scrollable after they create it: [[searchField cell] setScrollable:YES]. (They should do that in -[PVSearchToolbarItem initWithIdentifier:tag:itemProperties:], if you want to add that to your bug report. :-) )

    There’s a closely related bug in Interface Builder. NSTextFields and NSSearchFields have a layout setting, Scrolls (the default) or Wraps. When you change this from “Wraps” to “Scrolls”, it actually becomes not scrollable. (There are two cell flags which are mutually exclusive. Setting one to YES sets the other to NO, but the inspector is only changing the wraps flag… It must end up with both of them set to NO. I’ll file a bug report about this.)

  3. Pierre Igot says:

    Thanks for the additional information. It does seem silly that the default behaviour is not scrollable. How many real-world circumstances are there were you’d really want such a field to be not scrollable?

    ssp: Thanks for the “workaround.” It’s not really an option, though, simply because of the requirement to resize the window. In addition, the contents of the search field in the sheet is actually independent from the contents of the regular search field. It makes for a very confusing environment visually. (You get search results for a search request that is not the one that appears in the search field.)

Leave a Reply

Comments are closed.