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

[BUG]: Picker Add event does not give TagKey, does not allow quick entry, slow to update #439

Open
Universezero opened this issue Dec 5, 2023 · 2 comments
Labels
bug Something isn't working code Issue is related to a Power Apps code component Component: TagsPicker documentation Improvements or additions to documentation

Comments

@Universezero
Copy link

Universezero commented Dec 5, 2023

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:

  1. Add a Picker
  2. Set onChange to this code:
    `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

@Universezero Universezero added bug Something isn't working ⚠️ needs triage Has not been triaged by the team yet. labels Dec 5, 2023
@Universezero
Copy link
Author

Additionally, it would be great if the items in the Picker could be accessed via something like Picker.SelectedItems (since SelectedItems is a part of the Picker, but is always blank) as a way of easily accessing the Picker data rather than having to faff about with managing a collection.

@denise-msft denise-msft added code Issue is related to a Power Apps code component Component: TagsPicker documentation Improvements or additions to documentation and removed ⚠️ needs triage Has not been triaged by the team yet. labels Feb 7, 2024
@denise-msft
Copy link
Member

Thanks for your feedback @Universezero. We will investigate this and address as resources permit.

@denise-msft denise-msft added this to the Creator Kit - June 2024 milestone May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code Issue is related to a Power Apps code component Component: TagsPicker documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants