You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LionInput formatter logic should be working exactly the same (also on first render) whether defined before or after the modelValue property.
Actual Behavior
Instead, formatter isn't executed on the first render, so when input is not empty on first render , the modelValue stays the unwanted non-formatted value. This seems to be caused by executing the formatting in the requestUpdate phase of the lifecycle, instead of in the updated phase. On first render, in the requestUpdate phase, the formatter property might not be set yet, but the modelValue is set. In this case, formatting is skipped once. It works correctly if the formatter property is defined before the modelValue. See the simple demo, where the order of modelValue and formatter can be changed to see it working or not.
Expected behavior
LionInput
formatter
logic should be working exactly the same (also on first render) whether defined before or after themodelValue
property.Actual Behavior
Instead,
formatter
isn't executed on the first render, so when input is not empty on first render , themodelValue
stays the unwanted non-formatted value. This seems to be caused by executing the formatting in therequestUpdate
phase of the lifecycle, instead of in theupdated
phase. On first render, in therequestUpdate
phase, theformatter
property might not be set yet, but themodelValue
is set. In this case, formatting is skipped once. It works correctly if theformatter
property is defined before themodelValue
. See the simple demo, where the order ofmodelValue
andformatter
can be changed to see it working or not.https://studio.webcomponents.dev/edit/oTmMlxximgx4VBRsp68p/README.md?p=README.md
Additional context
Using the latest version of @lion/ui: v0.4.2
LionInput, which uses the
FormatMixin
mixin, where the bug is in.The text was updated successfully, but these errors were encountered: