fix #31601: (Mac) Fix toolbar focus 

It was a regression from writing an incorect condition when I fixed the search dialog issue #30271.