Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[form] how to check if form changed after prefill #547

Closed
LarsDenBakker opened this issue Feb 5, 2020 · 2 comments
Closed

[form] how to check if form changed after prefill #547

LarsDenBakker opened this issue Feb 5, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@LarsDenBakker
Copy link
Contributor

Describe the bug

When prefilling a form, there isn't any way to know whether the form has changed after prefilling. The form dirty value is true, while the prefilled value is false.

To Reproduce

See this reproduction: https://webcomponents.dev/edit/HgFCAaNA1jyOhkpWYiei

In firstUpdated I'm logging dirty and prefilled

Additional context

Is there another value that can be used for this?

@LarsDenBakker LarsDenBakker changed the title [form] dirty after prefill [form] how to check if form changed after prefill Feb 5, 2020
@daKmoR
Copy link
Collaborator

daKmoR commented Feb 5, 2020

that prefilled value looks definitely wrong 🙈

something strange is going on there... in the firstUpdated the value even of the input is wrong (e.g. it's prefilled false)
whereas if I select <lion-input name="firstName"> in the developer tools and do $0.prefilled it correctly says true
🙈

the idea is that if any of the form elements are prefilled that then the form/fieldset becomes prefilled... but it seems the fieldset is not prefilled...

definitely something wrong here... will need to investigate 😅

@gerjanvangeest gerjanvangeest added the bug Something isn't working label Feb 5, 2020
@tlouisse
Copy link
Member

tlouisse commented Feb 17, 2020

@LarsDenBakker There is an initInteractionState() that runs on connectedCallback.
This runs too early, since it only has the right values on registrationReady.

I have a fix in this in a branch: #583

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants