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

[LiveComponent] Fix form elements unsynced on load (need confirm?) #2376

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

smnandre
Copy link
Member

Q A
Bug fix? yes
New feature? no
Issues Fix #1958
License MIT

Let's try to fix #1958

Multiple iterations probably needed here

@carsonbot carsonbot added Bug Bug Fix LiveComponent Status: Needs Review Needs to be reviewed labels Nov 14, 2024
Copy link

📊 Packages dist files size difference

Thanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
Please review the changes and make sure they are expected.

FileBefore (Size / Gzip)After (Size / Gzip)
LiveComponent
live_controller.js 120.36 kB / 23.38 kB 120.53 kB0% / 23.41 kB0%

Comment on lines +33 to +36
const modelFields = [
...Array.from(component.element.querySelectorAll('[data-model]')),
...Array.from(component.element.querySelectorAll('form,input,select,textarea')),
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No?

Suggested change
const modelFields = [
...Array.from(component.element.querySelectorAll('[data-model]')),
...Array.from(component.element.querySelectorAll('form,input,select,textarea')),
];
const modelFields = component.element.querySelectorAll('[data-model],form,input,select,textarea')

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Nov 15, 2024
@smnandre smnandre changed the title [LiveComponent] Fix form elements unsynced on load [LiveComponent] Fix form elements unsynced on load (need confirm?) Nov 28, 2024
@smnandre
Copy link
Member Author

If people want to help, you can check this change on your project and tell here if everything OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix LiveComponent Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LiveComponent] ComponentWithFormTrait out-of-sync with browsers’ changes
3 participants