metabase icon indicating copy to clipboard operation
metabase copied to clipboard

Dashboard filters are only commited on enter, not blur

Open camsaul opened this issue 8 years ago • 8 comments

If I create a SQL query with two params, enter a value for the first, and hit Tab (which takes you to the next box) or click on the next box (or anywhere for that matter), the value in the first box is cleared.

out

This is a somewhat-serious bug because it's basically impossible to use a SQL Question with more than one parameter 💔

This is on the public-embedding branch (0.23.0-SNAPSHOT) with an unsaved Question.

camsaul avatar Feb 08 '17 23:02 camsaul

IIRC it was an intention decision to require you hit "enter" to commit the filter. It also happens with a single param, as well as on dashboards.

We can certainly revisit whether we should commit-on-blur though.

tlrobinson avatar Feb 08 '17 23:02 tlrobinson

The same thing happens if you just have one param and try to click to run the query:

out

camsaul avatar Feb 08 '17 23:02 camsaul

this behavior is pretty confusing, I think if a Metabase developer gets tripped up by it it's definitely going to trip up our users...

It's not indicated anywhere that you're supposed to press enter to "commit" a param. And if that's what's expected, should we allow people to tab between boxes?

camsaul avatar Feb 08 '17 23:02 camsaul

Yeah, I'm having a hard time remembering why we went with having to hit enter to commit the filter. I think I advocated for that, but it definitely looks weird in practice. Commit on blur or enter seems right, yeah?

mazameli avatar Feb 08 '17 23:02 mazameli

I find that the biggest issue is related to bringing back large amounts of data in a dashboard. If I have 2 filters to reduce the results and I have to hit enter after only entering 1 value (because it will disappear once I leave the field), then it may take longer than I want to retrieve the results. Would be better if I could enter both values, then enter (or whatever) to get the results.

sldorman avatar Nov 14 '17 16:11 sldorman

UPDATE May 2022: This is problematic on some mobile versions, where the keyboard doesn't let you fill in the data: https://discourse.metabase.com/t/filter-and-mobile-issue/19911


I cannot reproduce this on 0.31.2 with Firefox 65 in Native Query, but I can reproduce in Dashboard. So what to do, rename the issue again? :smirk:

Commit on blur would be nice. I've seen multiple users inputting text and then clicking on the next filter, just to see their previous input disappearing.

  • Native Query: Saves on blur screencast 2019-02-16 22 16 30
  • Dashboard: Reverts on blur screencast 2019-02-16 22 25 11

Related to #6552 and #2059

flamber avatar Feb 17 '19 04:02 flamber

@flamber @mazameli I'm not sure if this issue is relevant anymore. While we don't save on blur, the UI has changed and now there is a button to add the filter. And pressing tab in the input will move focus to this button and not reset the value:

Screenshot 2022-07-28 at 17 34 54

ranquild avatar Jul 28 '22 14:07 ranquild

Unassigning since the UI has changed and it's not clear what the correct behavior would be.

ranquild avatar Aug 04 '22 07:08 ranquild

@mazameli @kdoh even if the issue name is about dashboard, examples here are about query builder params.

So for query builder we have two types of inputs: inline and with popup (multiple values).

  • inline save value on change, so both blur and enter work fine
image
  • with popup - enter only commits the value inside input, but to save and apply it you have to hit a button with mouse image

  • datepicker is completely unusable from keyboard, so it can be used only with mouse image

As for dashboard filters, we have "popup" like inputs, where both enter and tab commit the value (puts it inside inbox), but blur (click on another filter) will remove the committed value. And I see it as the only wrong behaviour here. Could you please confirm and suggest some good UI pattern?

https://www.loom.com/share/4b7a9b6748394491b299391a65f94f9c

uladzimirdev avatar Jul 25 '23 10:07 uladzimirdev

Original issue

If I create a SQL query with two params, enter a value for the first, and hit Tab (which takes you to the next box) or click on the next box (or anywhere for that matter), the value in the first box is cleared.

It was addressed in previous version of the product, currently value is saved

https://www.loom.com/share/d56e3b4dcf624258951f9297f7b3d38e

As @flamber mentioned, problematic may be only editing filter values on some mobile devices, but we do not encourage working with dashboards on mobile (we even decided to hide edit button for small screens).

created an issue for date filter https://github.com/metabase/metabase/issues/32661

Regarding the lost value for the parameter with popup (without hitting enter), I didn't find any related issue, so current behaviour seems to be fine

uladzimirdev avatar Jul 26 '23 09:07 uladzimirdev