web-components icon indicating copy to clipboard operation
web-components copied to clipboard

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

Open web-padawan opened this issue 6 months ago • 1 comments

Description

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

https://github.com/vaadin/web-components/blob/3497f2311e36e85d2eb4a2277d236e688dc1f97a/packages/crud/src/vaadin-crud-mixin.js#L645-L649

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):

https://github.com/vaadin/web-components/blob/3497f2311e36e85d2eb4a2277d236e688dc1f97a/packages/crud/src/vaadin-crud-mixin.js#L670

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

web-padawan avatar May 06 '25 12:05 web-padawan