primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Dropdown inside p-dialog element opens under p-dialog footer

Open Vegim opened this issue 10 years ago • 31 comments

capture

Vegim avatar Nov 04 '16 13:11 Vegim

Try either appendTo="body" on dialog or allow overflow on dialog.

cagataycivici avatar Nov 13 '16 16:11 cagataycivici

Adding appendTo="body" don't solved the problem. I've added [style]="{width:'200px',position:'fixed'}" to p-dropdown but the button shows on top of dropdown.

primeng_-_ultima

ernestomar avatar Mar 15 '17 21:03 ernestomar

@Vegim were you able to resolve this issue, I am facing similar issue with a drop down inside dialog.

Naveen07 avatar Mar 17 '17 17:03 Naveen07

Do you have any z-index for the button?

cagataycivici avatar Mar 17 '17 18:03 cagataycivici

@Naveen07 i have tried the option appendTo=body back then but it didnt worked.

Vegim avatar Mar 17 '17 18:03 Vegim

@Vegim Did you tried any other approach to get this resolved. I recently started using primeng.

Naveen07 avatar Mar 17 '17 18:03 Naveen07

@Naveen07 Nope, I tried just the approaches mentioned in the answer.

Vegim avatar Mar 17 '17 18:03 Vegim

@cagataycivici @Vegim I was using primeng's pButton , I tried using a normal button and that fixed the issue :)

Naveen07 avatar Mar 17 '17 18:03 Naveen07

That is weird, we need to check this.

cagataycivici avatar Mar 17 '17 18:03 cagataycivici

I'm unable to replicate;

screen shot 2017-03-22 at 11 48 02

    <p-dialog header="Godfather I" [(visible)]="display" modal="modal" width="350" responsive="true">
        <span>The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding. 
           His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. 
           Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, 
           kind and benevolent to those who give respect,
           but given to ruthless violence whenever anything stands against the good of the family.</span>
           
       <p-dropdown [options]="cities" [(ngModel)]="selectedCity" placeholder="Select a City" appendTo="body" [style]="{'width':'100%'}"></p-dropdown>
    
        <p-footer>
            <div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
                <button type="button" pButton icon="fa-close" (click)="display=false" label="No"></button>
                <button type="button" pButton icon="fa-check" (click)="display=false" label="Yes"></button>
                <button type="button" pButton icon="fa-close" (click)="display=false" label="No"></button>
                <button type="button" pButton icon="fa-check" (click)="display=false" label="Yes"></button>
            </div>
        </p-footer>
    </p-dialog>

Which theme are you using?

cagataycivici avatar Mar 22 '17 08:03 cagataycivici

I'm using Ultima template. I'm trying to reproduce without send my entire project. Please give more time.

ernestomar avatar Mar 22 '17 14:03 ernestomar

Sorry cagataycivici It was my mistake. I've been adding the property:

appendTo="body"

To p-dialog instead to p-dropdown

Finally the combination (in p-dropdown):

appendTo="body" [style]="{'width':'100%'}"

Solved my problem.

ernestomar avatar Mar 22 '17 14:03 ernestomar

sorry @cagataycivici thank sfor you help , I applied appendTo="body" on p-dialog instead of dropdown. the issue is resolved now. But I have a issue with multi select drop down inside p-dialog. I was unable to select multiple values at a time from the multiselect dropdown, it gets minimized after every single selection.

this is my code <p-dialog> <p-multiSelect appendTo = "body" [options]="Data" class="ui-grid-col-4" [style]="{width :'100%'}" > </p-multiSelect> </p-dialog>

Naveen07 avatar Mar 23 '17 19:03 Naveen07

Please create another issue for that one.

cagataycivici avatar Mar 23 '17 19:03 cagataycivici

Can you please update the demo page of the dialog with this info? It was driving me crazy :)

Currently it has this section:

Overlays Inside

When dialog contents include other components with overlays such as dropdown, it is suggested to turn off the overflow of dialog content so that the overlays can be displayed outside of the dialog.

<p-dropdown [options]="cities" formControlName="selectedCity"></p-dropdown>

The example dropdown should have the appendTo="body" and an example of how to urn off the overflow of dialog content should also be added, as the way I did it didn't work, so I must have done it incorrectly: <p-dialog [contentStyle]="{'overflow': 'hidden'}">

andrei-ivanov avatar May 30 '17 12:05 andrei-ivanov

@Mrtcndkn Please add dropdown to the demo of dialog so that we can provide an example.

cagataycivici avatar Jun 06 '17 13:06 cagataycivici

@cagataycivici In progress.

Mrtcndkn avatar Jun 06 '17 13:06 Mrtcndkn

Maybe an example of how to turn off the overflow of dialog content too?

andrei-ivanov avatar Jun 06 '17 15:06 andrei-ivanov

appendTo="body" on the p-dropdown fixed the issue for me.

Crunkelton avatar Jul 24 '17 13:07 Crunkelton

'appendTo="body" will scroll the dropdown menu along with the body/container scroll. Can this be made fixed?

bhuvhi avatar Jul 20 '18 20:07 bhuvhi