Using Drupal 10.1.5, CiviCRM 5.66.2 and Drupal Webform 6.2.0-rc4, Webform CiviCRM 6.2.4 and CiviCRM Entity 4.0.0-alpha6
This may or may not be intended behaviour so asking the question here.
We have a form that users fill out and we widely use filters to improve usability on the autocomplete. e.g. If they are just choosing a sub contact type of 'School' only Schools are displayed. This has worked well for years.
This might be an edge case, but today a user could not enter a value, even though it existed on the database and was of the sub contact type that the filter was set on.
On investgation it turns out that this particular contact had two contact types against it; we'll call them 'type_a' and 'type_b'. The filter on the field was correctly set to contact type 'type_b'.
We use custom fields to capture certain types of information and occasionally two contacts may have more than one contact type against them, so it is something that is necessary for us.
My immediate work around has been to add these contacts to a Smart Group so that any created are added to this group by default regardless of what other contact types are assigned to them.
So is filtering on Contact Type 'by design' on a single type? I notice that it is possible to filter on multiple groups, but not multiple contact types, so perhaps that is what is intended? In our case, type_a comes before type_b when the contact is displayed (its alphabetical by the looks of it) and seems to take precedence - if I create a dummy field and filter on type_a, it works as intended. This implies whatever Contact Type is found first is the one that is used from a filtering perpective.