Tagify sporadically uses tag-text for tag-value

Wappler Version : 6.8.0
Operating System :
Server Model: node
Database Type:
Hosting Type:

Expected behavior

Tagify should always evaluate to the tag-value field when used in a form repeat

Actual behavior

Sometimes, not always, the tag-text value is sent in the form post.

How to reproduce

I cannot produce a consistently reliable use case of this, but here is what I am seeing.

Given this form repeat with a tagify component within:

<div is="dmx-form-repeat" id="component_recipe_list" dmx-bind:items="recipe_edit.data.recipe_components.count()?recipe_edit.data.recipe_components.groupBy(`recipe_id`).keys():0" sortable="true" handle=".draggable_step_handle" animation="400">
...
	<input class="form-control component_recipe" is="dmx-tagify" id="inp_component_recipe_id" name="child_recipe_id" mode="select" nocustom="true" min-chars="0" max-items="999" dmx-bind:data="get_all_planner_recipes.data.recipes" tag-text="title" tag-value="recipe_id" tag-image="primary_image" required="" dmx-bind:value="$value&gt;0?$value:null">
...
</div>

Most of the time, this works. The proper id is sent.

Screenshot 2024-07-31 at 3.37.21 PM

However sometimes, with the exact same data in the entire post, and the exact same selected value, the tag-text is sent:

I should note that the ternaries used in this are part of the troubleshooting...they were not used originally.

The only hint of a possibility is that I have so far only been able to make it fail when the tag-text begins with a numeric character. But even this does not ALWAYS fail.

Bump...

Bump - this is happening for me to

I'm wondering if it is for items that go beyond the max-items position when using 'Select' mode

Ya, this never got picked up so I had to switch to a standard select element.

My previous hypothesis about numeric characters fell apart, your theory seems more sound.

It appears to see it as a non-listed item so therefore uses the text entered as the value. The only reason I can think of is that it is only looking in a certain number of items

Does this only happen inside a form-repeat or also outside of it?

The max-items only limits the number of items that is shown in the autocomplete droplist.

I'm trying to reproduce the issue but currently have no success with that. If there is more information when it fails then perhaps I could pinpoint the problem, currently I have no idea where to search.

I had to pull these out of the app and go with a standard select so the problem went away.

I just now tried to recreate in a test page and can no longer see the issue.

@patrick This is happening to me as well. It appears to happen when there is a space at the beginning or end of the value for the tag-text runtime element.

@bpj and @mebeingken, could you see if that is the cause for you?

As an example, the First Name has a space at the end. If I remove it, then the form submits successfully. If I add it back it gets the error. I've validated with multiple records and this happened consistently.
image