Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Modal Window to support Dynamic Modal Resizing #4446

Open
jebner opened this issue Dec 20, 2022 · 1 comment
Open

Expose Modal Window to support Dynamic Modal Resizing #4446

jebner opened this issue Dec 20, 2022 · 1 comment

Comments

@jebner
Copy link

jebner commented Dec 20, 2022

We have a modal with a dynamic form. Based on a switch control, a large part of the form is displayed / hidden side-by-side with the existing form inside the same modal. Due to this, we would like to increase / decrease the modal size dynamically after it has been opened.

This could be easily achieved by setting the size / fullscreen properties on the NgbModalWindow.
Unfortunately, the NgbModalWindow is not exposed, so we used a little hack to access it: (ngbModalRef as any)._windowCmptRef.instance;

We see a few ways to add support for this:

  1. Expose the NgbModalWindow class, such that the NgbModalWindow can be injected into a child component (this is the technical approach we sort of achieve with the hack above)
  2. Add a public getter or field modalWindow on the NgbModalRef which provides _windowCmptRef.instance. This could return a custom-tailored interface type that only exposes what is reasonable to add to the public API

Or is there another way how we can achieve that?
Maybe we can help/provide a PR if we see a reasonable chance this would get integrated. But as it widens the public API I we would like to discuss first.

@maxokorokov
Copy link
Member

Related to #4281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants