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

Change of pDroppableDisabled property after ngAfterViewInit doesn't change element's behavior #17598

Open
4 tasks
drsgoodall opened this issue Feb 6, 2025 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@drsgoodall
Copy link

Describe the bug

Changing pDroppableDisabled after ngAfterViewInit does not change the drop behaviour. This was mentioned in bug #6694, but was not included in the fix.

I can get it working (in a copy of the directive) by replicating the fix and changing the following in https://github.com/primefaces/primeng/blob/master/packages/primeng/src/dragdrop/dragdrop.ts

from
@Input({ transform: booleanAttribute }) pDroppableDisabled: boolean = false;

to

  _pDroppableDisabled: boolean = false;

    @Input() get pDroppableDisabled(): boolean {
        return this._pDroppableDisabled;
    }
    set pDroppableDisabled(_pDroppableDisabled: boolean) {
        this._pDroppableDisabled = _pDroppableDisabled;

        if (this._pDroppableDisabled) {
            this.unbindDragOverListener();
        } else {
            this.bindDragOverListener();
        }
    }

Pull Request Link

#17597

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

Not sure how to go about a local build/test.

Reproducer

https://stackblitz.com/edit/github-q5oosh5u

Environment

Currently using primeng 17.18.15, but code is still the same in current master.

Angular version

17/18

PrimeNG version

v19

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

change pDroppableDisabled to true after component has initialised. Try dragging another element over the component.

Expected behavior

Expected to see the drop disabled image, but instead we still see the default action.

@drsgoodall drsgoodall added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant