Skip to content

[crud] Custom theme attribute on the slotted form is removed #9056

@web-padawan

Description

@web-padawan

Description

When using a component with some theme set e.g. as a custom slotted form, the theme attribute is reset:

if (theme) {
form.setAttribute('theme', theme);
} else {
form.removeAttribute('theme');
}

Expected outcome

Expected the theme to be preserved. We should probably change the logic to not propagate theme attribute to custom form, like it is done for a custom grid (see __gridPropsChanged observer):

if (grid === this._gridController.defaultNode) {

Minimal reproducible example

<vaadin-crud>
  <vaadin-vertical-layout slot="form" theme="spacing">
    <vaadin-text-field label="First" path="firstName"></vaadin-text-field>
    <vaadin-text-field label="Surname" path="lastName"></vaadin-text-field>
  </vaadin-vertical-layout>
</vaadin-crud>

Steps to reproduce

  1. Modify the dev page to use the snippet above
  2. Open the editor - notice the theme is missing

Environment

Vaadin version(s): 24.x

Browsers

Issue is not browser related

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