superset icon indicating copy to clipboard operation
superset copied to clipboard

Copying filter value with ending space

Open anait-lama opened this issue 2 years ago • 4 comments

How to reproduce the bug

  1. Open any dashboard with filter
  2. Copy filter value from word/notepad wth ending space
  3. Paste the value in the filter and apply the filter
  4. The filter will not work

Expected results

Filter should show not allow to use the value that is not in the list of its predefined values.

Actual results

The filter doesn't work

Screenshots

Copy-paste filter value without the space: image

Copy-paste filter value with the space: image

Environment

(please complete the following information):

  • browser type and version: Chrome 112.0.5615.138
  • superset version: 2.1.0

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [x] I have reproduced the issue with at least the latest released version of superset.
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.

anait-lama avatar May 04 '23 10:05 anait-lama

@anait-lama - May be adding a trim to filter text as well as data should help I think. Let me take a look at this.

Govindarajan-D avatar May 07 '23 19:05 Govindarajan-D

Hi we're also facing that issue. Very stressful.. Trim is not the solution. Because if you copy and paste a value to the filter field which is totally different of all values ( not even with a whitespace) in the filter list it also accepts it as filter value ( see picture attached ) and for sure the filters are not working because there is no data for that bogus filter value..

add bogus customer name by typing in: image

add bogus customer name by copy paste: image

You can see that the copy paste version connotes that there is a value for the bogus filter value

If anybody can help it would be really nice. It is a awkward behavior of the filter because it is not obvious for the user

best and thanks

vigodeltoro avatar Feb 07 '24 11:02 vigodeltoro

CC @michael-s-molina since as the expert on the Select input mechanics.

rusackas avatar Feb 07 '24 19:02 rusackas

We allow any input because, currently, our filters are limited to 1000 values which means that not all values are loaded on the client-side and we don't know if the inputed value exists or not in the database. There have been many discussions to remove this limitation but it's not trivial work and it never gets prioritized.

michael-s-molina avatar Feb 12 '24 15:02 michael-s-molina

Hi, @michael-s-molina thanks a lot for clarifying. Not the answer we were hoping for I guess.. but that explains the behavior.. best

vigodeltoro avatar Feb 20 '24 09:02 vigodeltoro

I think since this limitation is a known (and seemingly long-lasting) design byproduct, we can close this issue. If anyone disagrees, I'm happy to re-open it. If anyone wants to open an Ideas Discussion for a feature request, or open a SIP/PR to propose/implement a better design, we're open to all of that too! Just trying to clean up the backlog if this isn't going anywhere :)

rusackas avatar Jul 09 '24 17:07 rusackas