p-confirm dialog is always scrolled to the bottom when content overflows

Discussão em 'Angular' iniciado por wazza, Fevereiro 11, 2025.

  1. wazza

    wazza Guest

    I am using primeng confirm dialog in my application. When the content is more than the max height of the dialog, the dialog becomes scrollabel. However the content is always scrolled to the bottom & the user has to scroll up. This is not convenient for the user. I want to know how can I make the scroll start from the top instead of the bottom. Please help. Thanks in advance.

    Here is my template code:

    <p-confirmDialog header="Confirmation" [style]="{'overflow-y': 'auto', 'overflow-x': 'hidden',
    'max-height': '60vh','min-height':'150px'}" icon="pi pi-exclamation-triangle">
    </p-confirmDialog>


    My ts code:

    this.confirmationService.confirm({
    message: 'some big msg',
    header: 'Confirm',
    icon: 'pi pi-exclamation-triangle',

    accept: () => {
    console.log('Confirm');
    },
    reject: () => {
    console.log('Reject');
    }
    });

    Continue reading...

Compartilhe esta Página