lime-elements
lime-elements copied to clipboard
limel-dialog: if the `button` slot is empty when the component is created, it will never be shown, even if populated later
Found while helping @simonedeblasio debug, as described in this forum thread (internal link).
Current behavior
Steps to reproduce the behavior:
- Create a limel-dialog where no element in the dialog has
slot="button"
. - Give the page time to render, so the dialog is hydrated.
- Update the dialog by adding an element that has
slot="button"
set.
Result: the element with slot="button"
is not shown, because the dialog has no footer, and thus no slot to show it in.
Expected behavior
The element with slot="button"
should be shown in the dialog's footer. This happens because of https://github.com/Lundalogik/lime-elements/blob/b3d5d2fa6200fa370c0f9006cc58b314c0f7dbc9/src/components/dialog/dialog.tsx#L112, which we added because Lime Field needed a full screen dialog with no footer, if I recall correctly. I'm guessing this behaviour is no longer needed, so we can probably remove this little quirk, but if we don't, we should document it!
Environment
- lime-elements version: v0.8.0 and later (yes, v0.8.0 sic, 😂) This was introduced in #1222
- Framework used: none (StencilJS)
- Logs: