-
Notifications
You must be signed in to change notification settings - Fork 75
Not able to assign customizable options to modal #160
Comments
Hi @ersurajnegi, Quickly your code snippet seems alright, can you be more specific about the problem or provide the error if there is any? You can find the demo code here if it helps: |
Hi @jfcere, I did the exact as the links you have provided but still it didn't work. |
@ersurajnegi are you using I am asking because there is an issue with Materialize (closed 7 days ago) that state that they have an issue with dynamically added modals and the Unfortunatly if this is the case, beside using the modal HTML, there is not much we can do but wait for a new release of Materialize with the related fix. Update So it's kind of hard to tell whats going wrong without more information. Do you have a repository we can access to help you? |
@jfcere .... i am not using the modal service but what i am doing this.. my modal template is in child component and when i pass data to that child component then i am initializing modal in that child component. modal is getting opened but the options are not being set for that modal. Here is the link for the Child Component: Thanks for helping. :) |
I am also having this issue, i included the exact modalOptions from the example, and the exact modal from the example, and it seems that the modal options are not working, as the dissmissable is not working and neither are the callbacks. Is there an import we must have in the component?
|
@ersurajnegi thanks to your repository I've been able to identify the problem. Materialize issue Is there a fix? How I've been able to confirm open : function() {
// methods.init.apply( this, arguments );
$(this).trigger('openModal');
}, Now what? Is there a workaround? Note that using |
Materialize released version 0.100.0 yesterday which include the fix for the modal options. We are going to move foward to this version soon but we cannot give an exact date as we need to move the package from JQuery 2.4.x to 3.x. If it wasn't for that breaking changes, we wouldn't have lock the Materialize package. We are sorry about the inconvenience and we'll keep you in touch when we'll have a better idea of when our new release will be available. Thanks! |
Fyi we are working on updating the package to last Materialize/JQuery version which will resolve this issue. The update should be available for next release. |
@jfcere ..i tried using opening a modal with ModalService. but not able to do that. Getting below error in the browser console : ERROR TypeError: Cannot read property 'length' of undefined Please see attached file for modalComponent and service config: |
@ersurajnegi are you using angular 5 ? |
@jfcere... yes using 5.0.0 version. |
We haven't try it yet with Angular 5 but I know there is some issues. For the modal issue, Angular seems to have changes their |
Thanks @jfcere. |
You can go as far as angular 4.4.6 and you should'nt have any problem. Hmm, quickly, I got no idea for the This is handled by Materialize where element with For example...
Reference: https://sherweb.github.io/ng2-materialize/modal (see MzModalService section) |
I haven't changed anything about z-index anywhere. but still it is coming behind the modal-overlay. i found the solution somehow: |
That would have been my guess ... glad to know you found the problem. Materialize seems pretty picky about |
<mz-modal #bottomSheetModal [options]="modalOptions">
Test Header
TS file
The text was updated successfully, but these errors were encountered: