Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.58k stars 799 forks source link

Instant Search: Scroll to top when new filter is added #14614

Open gibrown opened 4 years ago

gibrown commented 4 years ago

Whenever a new filter is added we should scroll the overlay to the top rather than forcing the end user to do so.

jsnmoon commented 3 years ago

As @bluefuton mentioned here:

I'd say there are a couple of situations where it doesn't feel quite right.

  1. You can have enough filters for them to be scrollable and you want to select multiple filters (e.g. two months).

  2. You're on mobile and want to select multiple filters. The filters dropdown closes after selecting one filter.

Perhaps this feature is worth skipping for now?

jsnmoon commented 3 years ago

Related issue: https://github.com/Automattic/jetpack/issues/14783.

gibrown commented 3 years ago

You can have enough filters for them to be scrollable and you want to select multiple filters (e.g. two months).

I think this is tricky though because there are no guarantees that two filters won't end up with zero results. Your "two months" example for instance doesn't work because there won't be any results. That said...

You're on mobile and want to select multiple filters. The filters dropdown closes after selecting one filter.

I think this issue more makes sense on mobile, and maybe should only be true on mobile. On mobile as soon as you select a filter the filter menu closes which is why it feels a bit broken to not scroll back up to the top.

jsnmoon commented 3 years ago

I think this issue more makes sense on mobile, and maybe should only be true on mobile. On mobile as soon as you select a filter the filter menu closes which is why it feels a bit broken to not scroll back up to the top.

Would it be better to keep the filter menu open in the meanwhile?

gibrown commented 3 years ago

Could that PR you closed be refactored to work only on mobile?

jsnmoon commented 3 years ago

I'll go ahead and refactor the PR to keep the filter dropdown open for mobile. cc @gibrown @bluefuton