Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column Filter: Auto close on Click Outside does not work #13596

Closed
denny99 opened this issue Sep 1, 2023 · 1 comment · Fixed by #13619
Closed

Column Filter: Auto close on Click Outside does not work #13596

denny99 opened this issue Sep 1, 2023 · 1 comment · Fixed by #13619
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@denny99
Copy link
Contributor

denny99 commented Sep 1, 2023

Describe the bug

    bindDocumentClickListener() {
        if (!this.documentClickListener) {
            const documentTarget: any = this.el ? this.el.nativeElement.ownerDocument : 'document';

            this.documentClickListener = this.renderer.listen(documentTarget, 'click', (event) => {
                if (this.overlayVisible && !this.selfClick && this.isOutsideClicked(event)) {
                    this.hide();
                }

                this.selfClick = false;
            });
        }
    }

According to the code of the Column Filter, the filter should automatically hide when clicking outside.
It does not right now.

Side Note:
When you use a datepicker or autocomplete as filter input (with appendTo=body) the filter will close when fixing this bug.

Environment

PrimeNG Playground https://primeng.org/table#filter

Reproducer

https://primeng.org/table#filter

Angular version

16.x

PrimeNG version

16.3.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

x

Browser(s)

All

Steps to reproduce the behavior

  1. Goto the Menu Filter Demo
  2. Open a Filter Menu
  3. Click somewhere else or open other menus
  4. Won't close as coded

Expected behavior

Should close when clicking outside.

A solution for appendTo body inputs would be appreciated.

@denny99 denny99 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 1, 2023
denny99 pushed a commit to denny99/primeng that referenced this issue Sep 6, 2023
@cetincakiroglu cetincakiroglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Sep 25, 2023
@cetincakiroglu cetincakiroglu added this to the 16.4.0 milestone Sep 25, 2023
@cetincakiroglu cetincakiroglu removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 25, 2023
cetincakiroglu added a commit that referenced this issue Sep 25, 2023
fix(Column-Filter): #13596 Auto close on Click Outside does not work
@cetincakiroglu
Copy link
Contributor

Fixed in here #13619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants