Primeng: Error 'overlayAnimation' of undefined for click DropDown in Dialog (Static)

Created on 18 Nov 2020  路  2Comments  路  Source: primefaces/primeng

After adding the dialog and adding the dropdown to it, the problem occurs. When you first open and click on the drop-down list, there is no error, however, when you re-open and click on the drop-down list to open it, an error may occur (it can be like the second, third or any subsequent one - randomly).

Error text: ERROR
Error: Cannot read property 'overlayAnimation' of undefined

Example: https://github-d5uajw.stackblitz.io/

Most helpful comment

Just for anyone who deals with this unwanted behaviour, do not forget that in the documentation there is a solution for this: just add the attribute 'appendTo="body"' to your dropdown or autocomplete components that are inside your p-dialog...

All 2 comments

I found the reason for the solution.

  1. It turned out that the error is not random. An error occurs when adding a drop-down list to a static dialog box, after opening the dialog box, then clicking on the drop-down list and not clicking on the drop-down list item to close the dialog box, then upon reopening there will be an error when trying to open the drop-down list by clicking on it.
  1. To solve the problem when calling the event of hiding the dialog box, call the hiding of the drop-down list element.



hide (el) {
el.hide ()
}

Just for anyone who deals with this unwanted behaviour, do not forget that in the documentation there is a solution for this: just add the attribute 'appendTo="body"' to your dropdown or autocomplete components that are inside your p-dialog...

Was this page helpful?
0 / 5 - 0 ratings