bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Modal issue [2.0 wip]

Open kapso opened this issue 14 years ago • 12 comments

While creating a form inside a modal, i see the forms are not aligned property (they are left aligned), wasnt the case when I was using v1.4. Note - I am running bootstrap 2.0 with 1.4 modal bootstrap-modal.js (did not see a 2.0 modal script)

This is true for both default form style and horizontal.

kapso avatar Jan 25 '12 22:01 kapso

There is a bootstrap-modal.js. You must have missed it -> https://github.com/twitter/bootstrap/blob/2.0-wip/js/bootstrap-modal.js. Please check with the latest code and post some screenshots so we can see the problem.

pokonski avatar Jan 25 '12 22:01 pokonski

Thanks, I updated the modal to 2.0 JS. But now the modal functionality has stopped working completely, no modal popups. I am guessing the doc has changed for modals, dont see the docs on the bs2 website.

This is what I am using currently to invoke the modal -

<a href='#' data-controls-modal='check-help-dialog' data-keyboard='true'>Show Bank Account & Routing Number ?</a>

kapso avatar Jan 25 '12 23:01 kapso

You can see the 2.0 docs here, on my website http://okonski.org/bootstrap-zindex/docs/javascript.html#modals

pokonski avatar Jan 25 '12 23:01 pokonski

So here are the screenshots of alignment issues for forms inside a modal -

http://cl.ly/0h1H071J413S3F080k2O

http://cl.ly/3R2V0j0S0z3s2U1i313j

kapso avatar Jan 25 '12 23:01 kapso

Hi - I was wondering if this is an issue or something that I am doing wrong?

Also I tried using the grid system for layout inside a modal and it does not work.

kapso avatar Jan 27 '12 22:01 kapso

The screenshots look right to me and are as I'd expect things to appear. In what way are you using the grid classes for the modal? Do you have a jsfiddle or a demo somewhere?

mdo avatar Jan 27 '12 23:01 mdo

The modal doesn't work for me either in an upgrade situation.

It looks like Bootstrap is using JQuery 1.7+ features, and my existing code is 1.6.x. I can't see anywhere obvious where the JQuery version is specified.

tomfakes avatar Jan 28 '12 05:01 tomfakes

@tomfakes All our javascript requires the latest jQuery—that's on our Customize page now, and I just added it to the JS plugins page. If you have a separate problem with that, open another issue please.

mdo avatar Jan 28 '12 07:01 mdo

No I meant - when i create a horizontal form inside a modal I see alignment issues - http://cl.ly/3R2V0j0S0z3s2U1i313j

You can see its right aligned, is that how the default behavior would be in 2.0? coz in 1.4 I did not see any alignment issue, it was center aligned.

If thats the default behavior how do we layout content in a modal, using the grid system? I tried but heres what I got -

Here's my modal body code (Slim/HAML) -

.modal-body
   .row
      .span4
         .alert.alert-success.hide id='cc-form-alert'
         = render 'cc_form'
         hr
         div Some Info
         hr
      .span3
         h3 Some Content 
      .span3
         h3 Some Other Content

And here's how the content is being laid out in the modal - http://cl.ly/1I03070P2R2L0d2R1K15

kapso avatar Jan 28 '12 08:01 kapso

The form doesn't appear to be right aligned, but rather left aligned and the content just runs wide right. Inspect or view source and I think you'll find that negative space on the left is the fixed-width labels and the super wide input you have is pushing to the right too much.

For laying out content in the modal, you'll need to use a set of columns that matches the width of the modal. By default, our modals are not full width of the grid, so you need fewer columns. Also, if you want the form to be centered, just add margin: 0 auto; to them and you're set.

mdo avatar Jan 28 '12 08:01 mdo

Forgot to close this out. If there is still a problem, open a new issue. Thanks!

mdo avatar Jan 29 '12 08:01 mdo

Yea thats good, horizontal form inside a modal is center aligned now, dont know but its working without any change :)

Thanks for your all help, you guys are doing a phenomenal job with bootstrap.

kapso avatar Jan 29 '12 08:01 kapso