Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material input appears to allow multiple addition, but in fact allows only one #647

Open
gbathree opened this issue Mar 1, 2023 · 3 comments

Comments

@gbathree
Copy link

gbathree commented Mar 1, 2023

I am able to add multiple materials to the material type dropdown in the add quantity space in a log, but when I hit 'update quantity' it only saves on material.

It appears that in reality, only one material is possible to be added per quantity (which may be fine). If so, that dropdown box should not appear to allow more than one. Otherwise, if more than one is allowed, it should not remove the other added materials upon 'update quantity.

See image below.

image

@mstenta
Copy link
Member

mstenta commented Mar 1, 2023

Hmm good point.

We may also want to change the language of the description so it is more singular:

What type of materials are material is being applied?

@mstenta
Copy link
Member

mstenta commented Mar 1, 2023

Here is where that field is currently defined:

It delegates to the farmFieldFactory service which sets some field widget default settings for taxonomy_term reference fields:

@mstenta
Copy link
Member

mstenta commented Mar 1, 2023

I believe this is the low-level element that gets used by the widget: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21Element%21EntityAutocomplete.php/class/EntityAutocomplete/8.2.x

It provides this property:

#tags: (optional) TRUE if the element allows multiple selection. Defaults to FALSE.

I wonder if that has any affect on this behavior. I would imagine it is already set to FALSE though because we are not setting #multiple to TRUE... 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants