Skip to content

Conversation

@shyamal890
Copy link

Fixes #4680

Not sure if I should have updated the demo code for the reviewer. Regardless, here are two files you can modify to confirm that the functionality operates correctly.

popover-autoclose.html (Only changed part of the file)

      <li class="mb-2">
		click outside:
		<button
			type="button"
			class="btn btn-outline-secondary"
			popoverTitle="Pop title"
			[autoClose]="auto_close ? 'outside' : false"
			ngbPopover="pop1Content"
			#p="ngbPopover"
		>
			Click to toggle
		</button>
		<ng-template #pop1Content> Some information - </ng-template>
		<button type="button" class="ms-2 btn btn-outline-secondary" (click)="auto_close = !auto_close; cdr.detectChanges()"
			>Toggle AutoClose</button
		>
	</li>

popover-autoclose.ts

import { ChangeDetectorRef, Component } from '@angular/core';
import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';

@Component({
	selector: 'ngbd-popover-autoclose',
	standalone: true,
	imports: [NgbPopoverModule],
	templateUrl: './popover-autoclose.html',
})
export class NgbdPopoverAutoclose {
	auto_close = false;

	constructor(public cdr: ChangeDetectorRef) {}
}

Before submitting a pull request, please make sure you have at least performed the following:

  • read and followed the CONTRIBUTING.md and DEVELOPER.md guide.
  • built and tested the changes locally.
  • added/updated any applicable tests.
  • added/updated any applicable API documentation.
  • added/updated any applicable demos.

@shyamal890
Copy link
Author

Can someone please review this PR - @maxokorokov @jnizet

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Popover autoClose not dynamic

1 participant