question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NgbModalOptions size option should not be typed to 'sm' or 'lg'

See original GitHub issue

Bug description:

Currently the size property on the NgbModalOptions interface is strongly typed to accept only ‘sm’ or ‘lg’.

I understand that these 2 options are the defaults in bootstrap but using bootstrap sass mixins like the following, custom sizes can be created.

@include media-breakpoint-up(xl) {
  .modal-xl { max-width: $modal-xl; }
} // actually exists in bootstrap 4.2

@include media-breakpoint-up(xxl) {
  .modal-xxl { max-width: $modal-xxl; }
}

I don’t see the benefit to strongly typing this particular option and think it should just be typed as string.

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 7.x

ng-bootstrap: 4.0.2

Bootstrap: 4.x

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
maxokorokovcommented, Feb 13, 2019

I don’t see the point in adding the size variants plus string

Two examples:

  1. code completion

screen shot 2019-02-13 at 09 59 38

  1. API documentation

screen shot 2019-02-13 at 10 00 25

3reactions
ashgibsoncommented, Feb 12, 2019

I don’t see the point in adding the size variants plus string as string effectively creates a wildcard and removes any benefits of strictly typing this option.

Definitely need string added though as this package is falling behind the official bootstrap package.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - ng-bootstrap Modal size - Stack Overflow
I just add the <any> tag which is a workaround until the size type became '"sm" | "lg" | "xl" | string'. –...
Read more >
Modal - Angular powered Bootstrap
open(content: any, options: NgbModalOptions) => NgbModalRef ... size. Size of a new modal window. Type: 'sm' | 'lg' | 'xl' | string. windowClass....
Read more >
how to setup the size of a modal - Material Design for Bootstrap
hello, how do i modifiy the size of a modal. the modal-lg is not large enough for my case. ideally i would like...
Read more >
Angular 12 Bootstrap Modal Popup Example - Pass Data in ...
In this tutorial, we will install Ng Bootstrap in the Angular project and ... size : Modal window size can be set with...
Read more >
Modal - Bootstrap
Modals are built with HTML, CSS, and JavaScript. · Clicking on the modal “backdrop” will automatically close the modal. · Bootstrap only supports...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found