Closed seilmsteiner closed 4 years ago
@seilmsteiner
So in that case you would need to drop the previous TYPE filters for the updated one? Or do you need the filtered tag from the old TYPE after you updated too?
Investigation results:
The actual behavior should be like that. The distinct option does not apply to 'multiple changing' data sources but to one. The definition of distinct concerns one autocomplete or data source.
In @seilmsteiner's case, the problem is a bit different since it concerns a changing data source. Short summary:
Pick the first filter e.g: TYPE: 'string' (out of string, number)
then the second e.g: API: 'anything'
which results in the available TYPE filter options to change e.g: TYPE has only 'number' as an option now
Now the issue is that it should be distinct but since the distinct option doesn't concern changing data sources, the user can pick TYPE with new options again
IMO this issue is a feature request.
What is your opinion on that? @thomaspink @tomheller @lukasholzer
Closing this issue as it is not a bug nor a feature request.
Through the investigation the following this came up:
Investigation results:
The actual behavior should be like that. The distinct option does not apply to 'multiple changing' data sources but to one. The definition of distinct concerns one autocomplete or data source.
In @seilmsteiner's case, the problem is a bit different since it concerns a changing data source. Short summary: Pick the first filter
e.g: TYPE: 'string' (out of string, number)
then the seconde.g: API: 'anything'
which results in the available TYPE filter options to changee.g: TYPE has only 'number' as an option now
Now the issue is that it should be distinct but since the distinct option doesn't concern changing data sources, the user can pick TYPE with new options again
Why is this issue closed?:
As it turns out the filter field component doesn't support multiple datasources, since the probability of remembering old data causing memory leaks is too high. @seilmsteiner's issue is a special use-case for his project in a very specific manner and we can not handle such specific use-cases on our side.
Possible workaround would be: Datasources should not be reassigned but next()'ed
, so the distinct option applies as it doesn't distinguish between multiple reassigned datasources.
Bug Report
The distinct option on the filter field does not work if the selected filter value is no longer in the autocomplete list. Then it is still possible to add another filter of this category.
Expected Behavior
If the distinct option is applied, the filter field should not allow another filter of this category in any situation.
Current Behavior
It is possible to apply to filters of the same category, although distinct=true is set.
Possible Solution
Only a workaround: add the applied filters always to the suggestion list
Steps to Reproduce
https://stackblitz.com/edit/github-1hiynz?file=src%2Ffilter-field%2Ffilter-field-partial-example%2Ffilter-field-partial-example.ts
add filter "AUT" - "Linz"
after the filter is applied I change the suggestion list in the method filterChanged(..)
then it is possible to add another filter of "AUT"
Context (Environment)
In Memory Profiling: