materialize icon indicating copy to clipboard operation
materialize copied to clipboard

modal.leanModal({dismissible:false}) does not work: tested

Open rkstar opened this issue 11 years ago • 16 comments

issue #1239 is valid.

tested and demonstrated here: http://codepen.io/anon/pen/oXBKeg using example copied from: http://materializecss.com/modals.html

OSX Yosemite / Chrome Version 43.0.2357.81 (64-bit)

OSX Yosemite / Firefox Version 38.0.1

rkstar avatar Jun 01 '15 20:06 rkstar

the open function allows you to pass in different options. The leanModal call is for setting up a trigger and is not meant to be called on the modal itself. http://codepen.io/Dogfalo/pen/qdrBev

Dogfalo avatar Jun 02 '15 06:06 Dogfalo

Please update the documentation to reflect this.

rkstar avatar Jun 02 '15 10:06 rkstar

Ran into this too, please update documentation.

It's very unintuitive, I'd even call for a design change, such that calling openModal without any arguments would default to the arguments it's been initialized with.

neopostmodern avatar Jun 20 '15 12:06 neopostmodern

Is it possible to set "ready" and "complete" callback functions of the modal, without opening the modal ?

bsrdjan avatar Aug 07 '15 16:08 bsrdjan

mdoals

its added to documenttaion.

suryasarafe1 avatar Nov 25 '15 04:11 suryasarafe1

The problem is with including jquery. if you have 2 jquery included while setting no conflict to $ use jQuery 2.1X.x and it will work for you !

include in following order

src="https://code.jquery.com/jquery-2.1.4.min.js"> rel="stylesheet" href="./css/materialize.min.css" media="screen,projection"/> src="./js/velocity.min.js"> src="js/materialize.min.js">

Hope this will help you

erBhushanPawar avatar Dec 17 '15 08:12 erBhushanPawar

Thanks @erBhushanPawar! My mistake is including materializecss.js before jquery and I have a lot of problems - not working modals, toasts etc... You save my day!

vmkazakoff avatar Jan 21 '16 05:01 vmkazakoff

hey guys. I've got a serious problem with modals. it doesnt' respond. I've initialised and done the coding - a copy and paste from the website- but it still doesnt work. Please could some one just post the code to include in my js file. i think that is where my prob is.

conrald07 avatar Feb 15 '16 11:02 conrald07

$('#modalConfirmOrder').openModal({ dismissible: false, // Modal can't be dismissed by clicking outside of the modal opacity: .5, // Opacity of modal background in_duration: 300, // Transition in duration out_duration: 200, // Transition out duration ready: function() { }, // Callback for Modal open complete: function() { /*alert('Closed');*/ } // Callback for Modal close });

also make sure that you have addressed previous solution too

erBhushanPawar avatar Feb 15 '16 11:02 erBhushanPawar

thanks a lot @erBhushanPawar. But just one more question. i"ld like to call this function onclick(an image for example). this code runs from when my tab loads.

conrald07 avatar Feb 15 '16 13:02 conrald07

Oh. I got it!!!. Thanks again.

conrald07 avatar Feb 15 '16 13:02 conrald07

@Dogfalo Could you please add it back to the documentation? Why was it taken out again? It's important to know that openModal() can take options.

fedpettinella avatar Sep 28 '16 13:09 fedpettinella

There is no more openModal(). It's been changed to .modal('open'). Does anyone knows how to open modal and add a callback now?

Also does anyone else has problems with opening modals programatically using the .modal('open')? It seems it doesn't work for me.

dbr0 avatar Dec 04 '16 17:12 dbr0

@dbr0 Dude, I think they have adapted bootstrap method this time. I hope this document will help you http://www.w3schools.com/bootstrap/bootstrap_ref_js_modal.asp

erBhushanPawar avatar Dec 05 '16 05:12 erBhushanPawar

@erBhushanPawar Using .modal('show')' from link you have given gives Error: Method show does not exist on jQuery.modal`.

dbr0 avatar Dec 06 '16 08:12 dbr0

Not working on clicking on browser back button.

Still the modal '.modal-overlay' exist on DOM.

bspatil0001 avatar Sep 05 '17 11:09 bspatil0001