Primeng: Attributes for Modal Dialog not working as intended

Created on 26 May 2016  路  1Comment  路  Source: primefaces/primeng

Dialog.prototype.ngAfterViewInit = function () { var _this = this; this.contentContainer = this.domHandler.findSingle(this.el.nativeElement, '.ui-dialog-content'); this.center(); if (this.draggable) { this.documentDragListener = this.renderer.listenGlobal('body', 'mousemove', function (event) { _this.onDrag(event); }); }

Was trying to get the draggable attribute to turn to false so the user cannot drag the modal dialog around. I narrowed the issue down to the dialog.js file code shown above. Inspecting in Chrome dev tools shows that the comparison if(this.draggable) {...} is receiving the string value of "false" instead of the boolean value of false, so it always sets up the drag event.

I changed the dialog.js file to if(this.draggable != "false") and achieved the desired result.

Most helpful comment

Nevermind on this. I did a search of the other issues and found that when using the attributes I need to use square brackets around the attribute name to get it to work.

so it should look like this...

<p-dialog header="Login" [(visible)]="display" [draggable]=false>

>All comments

Nevermind on this. I did a search of the other issues and found that when using the attributes I need to use square brackets around the attribute name to get it to work.

so it should look like this...

<p-dialog header="Login" [(visible)]="display" [draggable]=false>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Helayxa picture Helayxa  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

pchristou picture pchristou  路  3Comments

KannanMuruganmony picture KannanMuruganmony  路  3Comments

just-paja picture just-paja  路  3Comments