[BUG]: Picker Add event does not give TagKey, does not allow quick entry, slow to update #439
Labels
bug
Something isn't working
code
Issue is related to a Power Apps code component
Component: TagsPicker
documentation
Improvements or additions to documentation
Milestone
Describe the bug
There seems to be a number of problems with the Picker that makes it fairly unusable for me, despite there not seeming to be any alternative control in PowerApps that provides the same functionality.
First off, the documentation for the Picker is incorrect. It says that TagsDisplayName is "the text that is used to create a new Tag when the On Change event is fired", but this is not true - it's the label from your item collection that is used as the text for the tags. Which means that to add an item to your item collection when it's entered, the only way I can seem to capture this value is through SearchTerm, since the Add event does not supply a TagKey if the typed item is not in the suggestion collection. However, I've found that if I type quickly (i.e. type in text, then quickly hit enter), the SearchTerm is blank. This makes it impossible to quickly type lots of items into the Picker, which you can do if the Picker Items is not tied to a collection - however, without a collection, the data cannot be captured.
Additionally, working with a collection seems to make the picker very slow - I remove an item, and it takes 1000 milliseconds or more to remove it. Same goes for adding.
I thought I might be able to get around this behaviour by simply not providing an Items collection, and adding/removing items from a separate collection through the OnChange. However, the Picker doesn't fire ANY Add or Remove TagEvents if it doesn't have a Items collection! It would be great if it did, since without an Items collection the Picker actually works quickly to add and remove items.
To Reproduce
Steps to reproduce the behavior:
`Set(event, "TagEvent: " & Self.TagEvent & Char(10) & "TagKey: " & Self.TagKey & Char(10) & "SearchTerm: " & Self.SearchTerm & Char(10) & "TagsDisplayName: " & Self.TagsDisplayName);
If(Self.TagEvent = "Add",
With({selection: If(IsBlank(Self.TagKey), Self.SearchTerm, Self.TagKey)},
If(!IsBlank(selection) && IsBlank(LookUp(col_Tags, Value = selection)),
Collect(
col_Tags,
{Value: selection}
)
)
)
);
If(Self.TagEvent = "Remove",
RemoveIf(
col_Tags,
Value = Text(Self.TagKey)
)
);`
3. Set Items to 'col_Tags', and TagsKey and TagsDisplayName both to "Value"
4. Add a text label with variable 'event' as the text (helps to show the issues)
5. Add/remove items, both quickly and with a delay in hitting enter
Expected behavior
Should be able to add/remove items to and from the Picker quickly.
AB#1685
The text was updated successfully, but these errors were encountered: