Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Filter field: autocomplete stays open when clicking into another filter field #840

Closed
evan-bradley opened this issue Apr 7, 2020 · 1 comment · Fixed by #849
Closed
Assignees
Labels
bug A broken behaviour that was working previously has-pr P3 Important issue that needs to be resolved

Comments

@evan-bradley
Copy link

Bug Report

Expected Behavior

The autocomplete in a filter field should close when clicking into another filter field, just like it would for anywhere else in the page.

Current Behavior

When clicking directly into two filter fields, the autocomplete menus for both will be open.

Possible Solution

This likely sources from the filter field swallowing the click event in the _handleHostClick method.

Steps to Reproduce

StackBlitz: https://stackblitz.com/edit/github-dixtrt

  1. Click into top filter field (the autocomplete will open)
  2. Without clicking anywhere else on the page, click into the bottom filter field
  3. Both filter fields will have their autocomplete menus open now.

Context (Environment)

We are currently presenting the user with an option to manage two sets of filters on a single set of tag data. The filter fields are close to each other, so can be activated at the same time.

Used Versions:

  • node: v12.13.0
  • npm: 6.14.1
  • typescript: 3.8.3
  • angular: 9.0.6
  • @angular/cdk: 9.1.0
  • @dynatrace/barista-components: 6.1.1

Detailed Description

The autocomplete for a tag filter should close when clicking into another tag filter.

Possible Implementation

Either the _getFreeTextOutsideClickStream method or the _handleHostClick method should probably handle this.

Attachments

DeepinScreenshot_select-area_20200407101854

@evan-bradley evan-bradley added the bug A broken behaviour that was working previously label Apr 7, 2020
@evan-bradley evan-bradley changed the title Filter field: close autocomplete when clicking into another filter field Filter field: autocomplete stays open when clicking into another filter field Apr 7, 2020
@tomheller
Copy link
Collaborator

Hey @evan-bradley !
Thank you for reporting this, I was also able to reproduce this in our development environment, and you are right that it is probably the outsideClick handling that is preventing it from closing.

We have had some focus management issues with the filter field in the past and sadly it's not as trivial, but we will look into this problem.

@tomheller tomheller self-assigned this Apr 8, 2020
@tomheller tomheller added the P3 Important issue that needs to be resolved label Apr 8, 2020
tomheller added a commit that referenced this issue Apr 8, 2020
…en at the same time.

To ensure that only one filterfield flap is open at the same time, we need to store
the instance of the open flap in a global / module scope. If another filter field is focussed,
it should close the panels of the currently opened one and then reassign itself into the
open position.

Fixes #840
tomheller added a commit that referenced this issue Apr 9, 2020
…en at the same time.

To ensure that only one filterfield flap is open at the same time, we need to store
the instance of the open flap in a global / module scope. If another filter field is focussed,
it should close the panels of the currently opened one and then reassign itself into the
open position.

Fixes #840
tomheller added a commit that referenced this issue Apr 9, 2020
…en at the same time.

To ensure that only one filterfield flap is open at the same time, we need to store
the instance of the open flap in a global / module scope. If another filter field is focussed,
it should close the panels of the currently opened one and then reassign itself into the
open position.

Fixes #840
tomheller added a commit that referenced this issue Apr 9, 2020
…en at the same time.

To ensure that only one filterfield flap is open at the same time, we need to store
the instance of the open flap in a global / module scope. If another filter field is focussed,
it should close the panels of the currently opened one and then reassign itself into the
open position.

Fixes #840
lukasholzer pushed a commit that referenced this issue Apr 14, 2020
…en at the same time.

To ensure that only one filterfield flap is open at the same time, we need to store
the instance of the open flap in a global / module scope. If another filter field is focussed,
it should close the panels of the currently opened one and then reassign itself into the
open position.

Fixes #840
github-actions bot pushed a commit that referenced this issue Apr 14, 2020
…en at the same time.

To ensure that only one filterfield flap is open at the same time, we need to store
the instance of the open flap in a global / module scope. If another filter field is focussed,
it should close the panels of the currently opened one and then reassign itself into the
open position.

Fixes #840
github-actions bot pushed a commit that referenced this issue Apr 14, 2020
…en at the same time.

To ensure that only one filterfield flap is open at the same time, we need to store
the instance of the open flap in a global / module scope. If another filter field is focussed,
it should close the panels of the currently opened one and then reassign itself into the
open position.

Fixes #840
yngrdyn pushed a commit to yngrdyn/barista that referenced this issue Nov 9, 2020
…en at the same time.

To ensure that only one filterfield flap is open at the same time, we need to store
the instance of the open flap in a global / module scope. If another filter field is focussed,
it should close the panels of the currently opened one and then reassign itself into the
open position.

Fixes dynatrace-oss#840
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug A broken behaviour that was working previously has-pr P3 Important issue that needs to be resolved
Projects
None yet
2 participants