Review main Merged

75414[BUGFIX] Reflect size property to attribute in icon-element

Helmut Hummel CR +2 V +2 Easy +3 −3 updated 08/12/22, 20:10

Commit message

When using the custom element <typo3-backend-icon>
with a JS framework, that renders the DOM (e.g. Vue),
it can happen, that they set the properties of the custom element
instead of an attribute.

Since Lit does not reflect these properties to attributes by default,
but the icon-element relies on CSS set on the host element that depends
on the size attribute, the icon is not rendered in the correct size.

See: https://web.dev/custom-elements-best-practices/
on why reflecting properties to attributes might be a good idea
in some cases.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
    • Anja Leichsenring +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
    • Anja Leichsenring +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 912

  1. Helmut Hummel uploaded patch set 1 08/10/22, 22:51

  2. Helmut Hummel rebased onto patch set 2 08/10/22, 22:51

  3. core-ci voted on patch set 1 V -1 08/10/22, 23:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30027

  4. core-ci voted on patch set 2 V +1 08/10/22, 23:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30028

  5. Benjamin Franzke uploaded patch set 3 08/11/22, 04:28

  6. Benjamin Franzke commented on patch set 3 08/11/22, 04:28

    icon-element.ts:48

    size used to be the current font-size when not expicitly given, at least in v11 (the default assignment to Sizes.default was actually wrong). So with this change the attribute would always be set to "default" when not explicitly specified as attribute or property. For that reason I'd default to null here.
  7. core-ci voted on patch set 3 V +1 08/11/22, 04:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30033

  8. Anja Leichsenring voted on patch set 3 V +1 CR +1 08/12/22, 19:54

  9. Christian Kuhn voted on patch set 3 V +1 CR +1 08/12/22, 19:54

  10. Stefan Bürk voted on patch set 3 V +1 CR +1 08/12/22, 19:54

  11. Stefan Bürk voted on patch set 3 V +2 CR +2 08/12/22, 20:10

  12. Stefan Bürk merged patch set 4 08/12/22, 20:10