dougludlow / ng2-bs3-modal

Angular Bootstrap 3 Modal Component
http://dougludlow.github.io/ng2-bs3-modal/
ISC License
261 stars 133 forks source link

escape key #7

Closed servicepartnerplatform closed 8 years ago

servicepartnerplatform commented 8 years ago

Apparently if you leave the tabindex="-1" off the div, the escape key wont close the modal automatically.

Any chance you could add an input for the modal to not close on escape which sets that tabindex?

Thanks!

Love the modal otherwise!

dougludlow commented 8 years ago

v0.1.5 adds support for the keyboard option. You can now set [keyboard]="false". See the following example:

<button type="button" class="btn btn-default" (click)="modal.open()">Open me!</button>

<modal #modal [keyboard]="false" [backdrop]="'static'">
    <modal-header [show-close]="false">
        <h4 class="modal-title">I'm a modal!</h4>
    </modal-header>
    <modal-body>
        Hello World!
    </modal-body>
    <modal-footer [show-default-buttons]="true"></modal-footer>
</modal>

Thanks to @Beardles for the submission.

servicepartnerplatform commented 8 years ago

Thanks for adding this. So I take it I was the second one to ask for this? On Mar 5, 2016 11:18 AM, "Douglas Ludlow" notifications@github.com wrote:

v0.1.5 https://github.com/dougludlow/ng2-bs3-modal/releases/tag/v0.1.5 adds support for the keyboard option http://getbootstrap.com/javascript/#modals-options. You can now set [keyboard]="false". See the following example:

<button type="button" class="btn btn-default" (click)="modal.open()">Open me!

<modal #modal [keyboard]="false" [backdrop]="'static'"> <modal-header [show-close]="false">

</modal-header>
<modal-body>
    Hello World!
</modal-body>
<modal-footer [show-default-buttons]="true"></modal-footer>

Thanks to @Beardles https://github.com/Beardles for the submission.

— Reply to this email directly or view it on GitHub https://github.com/dougludlow/ng2-bs3-modal/issues/7#issuecomment-192680620 .

dougludlow commented 8 years ago

Apparently so :smile:

servicepartnerplatform commented 8 years ago

Works great. Thanks again. On Mar 5, 2016 1:07 PM, "Douglas Ludlow" notifications@github.com wrote:

Apparently so [image: :smile:]

— Reply to this email directly or view it on GitHub https://github.com/dougludlow/ng2-bs3-modal/issues/7#issuecomment-192699638 .