Do not display "Existing contact" fields as autocomplete when not configured as such

Created on 12 April 2023, over 1 year ago
Updated 24 April 2023, over 1 year ago

Problem/Motivation

Existing Contact fields can be configured to display as either an autocomplete, or a select field, or a textfield ("Enter Contact ID"), or be hidden. When selecting the textfield ("Enter Contact ID") option, the field will nevertheless be displayed as an autocomplete field. That is due to JS code only checking for whether the field ist "not a select field".

Detailed steps to reproduce

  1. Create a Webform with CivICRM processing enabled
  2. Enable a contact and add the "Existing" Contact field
  3. Go to the "Build" tab and edit the "Existing Contact" field to display as "Enter Contact ID" for form display and disable prepopulation from URL or current contact
  4. View the Webform, the "Existing Contact" field is being displayed as if it were an autocomplete field, while it should be just a simple textfield. It's basically just as if it were configured to be an "autocomplete" field, which is a separate form display option.

Proposed resolution

Add an is-autocomplete attribute for the webform field and let the JS code depend on that rather than the field not being a select field for initializing autcomplete behavior.

🐛 Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

🇩🇪Germany jensschuppe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024