Problem/Motivation
The UI of the element for a multivalued field is not same as a field with single cardinality.
Steps to reproduce
- Add an entity reference field with cardinality 1.
- Choose Autocomplete Deluxe as the form widget.
- Check the entity form

Proposed resolution
The UI of the element should be consistent
Remaining tasks
- ✅ File an issue
- ✅ Addition/Change/Update/Fix
- ✅ Testing to ensure no regression
- ➖ Automated unit testing coverage
- ➖ Automated functional testing coverage
- ➖ UX/UI designer responsibilities
- ➖ Readability
- ➖ Accessibility
- ➖ Performance
- ➖ Security
- ➖ Documentation
- ✅ Code review by maintainers
- ✅ Full testing and approval
- ✅ Credit contributors
- ✅ Review with the product owner
- ✅ Release notes snippet
- ✅ Release autocomplete_deluxe-2.0.4
UI interface changes
Unlimited

Limited to one

Limited to 2

API changes
- N/A
Data model changes
- N/A
Release notes snippet
- Issue #3273248 by sickness29, imalabya: Fixed not working single value field for Autocomplete Deluxe element UI
Issue fork autocomplete_deluxe-3273248
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
sandzel commentedI can confirm the issue.
One more step should be added:
- The autocomplete deluxe field should have HELP TEXT filled;
- Use Thunder Admin theme
Comment #3
freelylw commentedsame for the latest 2.03 version here.
Comment #4
sickness29 commentedComment #5
sickness29 commentedI have removed single widget variant theming and script and made single value field use multiple widget as well.
Also implemented validation for cardinality so now it happens as user adds values and not on form submit which is better from UX standpoint
Comment #6
sickness29 commentedComment #7
rajab natshahComment #8
rajab natshahComment #11
sickness29 commentedI have adjusted the patch a bit to allow users to choose whether they want multiple value design for single value fields and also left single value widget styles and scripts. By default the option is disabled to maintain same behaviour for existing fields.
Comment #13
rajab natshahComment #15
rajab natshahNoticed that
#multiplewas removedand a new
always_multiplewas introducedthis will break old sites
Reverted, to have a better logic and updatable direction.
Comment #16
rajab natshahComment #17
rajab natshahI had a 2nd round of testing on the fix from #5.
Thank you, Andrew, I agree with your changes.
With small changes and validation
Tested with
Unlimited

Limited to one

Limited to 2

Comment #18
rajab natshahComment #20
rajab natshahComment #21
rajab natshahComment #22
rajab natshahComment #23
rajab natshah✅ Released autocomplete_deluxe-2.0.4