Skip to content

[dialog] Allow passing content to header / footer slots, set has-header and has-footer #10339

@web-padawan

Description

@web-padawan

Describe your motivation

In V25, we support slotted content for vaadin-popover (that has only the default slot).
Same should work in vaadin-dialog in case only default slot and header title are set.

However, vaadin-dialog is lacking some logic for handling header and footer slots.

Describe the solution you'd like

Make it possible to use header and footer slotted content (default slot should in theory work).

In particular, adjust logic for setting has-header and has-footer when such content is present.
Currently, these attributes are only set when headerRenderer or footerRenderer are defined:

// Set attributes here to update styles before detecting content overflow
setOverlayStateAttribute(this, 'has-header', !!headerRenderer);
setOverlayStateAttribute(this, 'has-footer', !!footerRenderer);

Note: we could then also consider updating vaadin-confirm-dialog and vaadin-crud-dialog:

// ConfirmDialog has header and footer but does not use renderers
this.setAttribute('has-header', '');
this.setAttribute('has-footer', '');

// CRUD has header and footer but does not use renderers
this.setAttribute('has-header', '');
this.setAttribute('has-footer', '');

Additional context

Similar issue for vaadin-select: #9977

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions