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

Let NgBootstrap typeahead window to get out of the modal borders #9054

Merged
merged 2 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ export default `
box-shadow: none;
}
ngb-typeahead-window {
width: 100%;
max-height: 25em;
overflow-y: scroll !important;
z-index: 1050;
}

@keyframes fadeInTop {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './error.handler';
export * from './lazy-style.handler';
export * from './datepicker-config';
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './ng-bootstrap-config.provider';
export * from './route.provider';
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { APP_INITIALIZER } from '@angular/core';
import { NgbInputDatepickerConfig, NgbTypeaheadConfig } from '@ng-bootstrap/ng-bootstrap';

export const NG_BOOTSTRAP_CONFIG_PROVIDERS = [
{
provide: APP_INITIALIZER,
useFactory: configureNgBootstrap,
deps: [NgbInputDatepickerConfig, NgbTypeaheadConfig],
multi: true,
},
];

export function configureNgBootstrap(
datepicker: NgbInputDatepickerConfig,
typeahead: NgbTypeaheadConfig,
) {
return () => {
datepicker.container = 'body';
typeahead.container = 'body';
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ConfirmationComponent } from './components/confirmation/confirmation.co
import { HttpErrorWrapperComponent } from './components/http-error-wrapper/http-error-wrapper.component';
import { LoaderBarComponent } from './components/loader-bar/loader-bar.component';
import { LoadingComponent } from './components/loading/loading.component';
import { ModalCloseDirective } from './components/modal/modal-close.directive';
import { ModalContainerComponent } from './components/modal/modal-container.component';
import { ModalComponent } from './components/modal/modal.component';
import { SortOrderIconComponent } from './components/sort-order-icon/sort-order-icon.component';
Expand All @@ -33,12 +34,11 @@ import { TableSortDirective } from './directives/table-sort.directive';
import { ErrorHandler } from './handlers/error.handler';
import { initLazyStyleHandler } from './handlers/lazy-style.handler';
import { RootParams } from './models/common';
import { NG_BOOTSTRAP_CONFIG_PROVIDERS } from './providers';
import { THEME_SHARED_ROUTE_PROVIDERS } from './providers/route.provider';
import { THEME_SHARED_APPEND_CONTENT } from './tokens/append-content.token';
import { HTTP_ERROR_CONFIG, httpErrorConfigFactory } from './tokens/http-error.token';
import { httpErrorConfigFactory, HTTP_ERROR_CONFIG } from './tokens/http-error.token';
import { DateParserFormatter } from './utils/date-parser-formatter';
import { ModalCloseDirective } from './components/modal/modal-close.directive';
import { initDatepickerConfig } from './handlers/datepicker-config';

const declarationsWithExports = [
BreadcrumbComponent,
Expand Down Expand Up @@ -111,19 +111,14 @@ export class ThemeSharedModule {
deps: [Injector],
useFactory: initLazyStyleHandler,
},
{
provide: APP_INITIALIZER,
multi: true,
deps: [Injector],
useFactory: initDatepickerConfig,
},
{ provide: HTTP_ERROR_CONFIG, useValue: httpErrorConfig },
{
provide: 'HTTP_ERROR_CONFIG',
useFactory: httpErrorConfigFactory,
deps: [HTTP_ERROR_CONFIG],
},
{ provide: NgbDateParserFormatter, useClass: DateParserFormatter },
NG_BOOTSTRAP_CONFIG_PROVIDERS,
{
provide: VALIDATION_BLUEPRINTS,
useValue: {
Expand Down