make the search/replace button actually finish
all the internal work before returning from the button callback

closes PR 14906