10up / ElasticPress

A fast and flexible search and query engine for WordPress.
https://elasticpress.io
GNU General Public License v2.0
1.24k stars 312 forks source link

BUG: Keep ep-post_type in query string for Instant Results if #3868

Closed burhandodhy closed 5 months ago

burhandodhy commented 5 months ago

Describe the bug

Currently, if the search form has a hidden post_type field, Instant Results respects that field on a first try, but removes that filter from the query string as soon as a new term is entered. 

Steps to Reproduce

  1. Have a search form with a hidden field <input type="hidden" name="post_type" value="post">
  2. Search for any term, and it will only fetch the posts from the post type
  3. Once the Modal is opened, Retype the same term, and it will search the posts from all the post types. 

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct