Trim trailing whitespace
Add onSearchSubmit callback option