Skip to content

Conversation

weaverryan
Copy link
Member

@weaverryan weaverryan commented Sep 21, 2022

Q A
Bug fix? yes
New feature? no
Tickets Fixes #469 Fixes #473
License MIT

This does 3 unrelated things to close #469 and #473

NOTE: BUILT ON TOP OF #466.

A) [X] Documents how to change a "model" field via JavaScript
B) [X] Fixes a problem where a select element is rendered without an empty option, and so the component data isn't aware of the pre-selected option.
C) [X] Automatically set the value of a data-model field - #473.

Cheers!

@weaverryan weaverryan changed the title [Live] Doc'ing how to set values via JavaScript + fix select sync bug [Live] Doc'ing how to set values via Js, select sync bug & auto-setting data-model values Sep 22, 2022
@weaverryan weaverryan changed the title [Live] Doc'ing how to set values via Js, select sync bug & auto-setting data-model values [Waiting][Live] Doc'ing how to set values via Js, select sync bug & auto-setting data-model values Sep 23, 2022
… sync empty select fields

2 features/bugs mixed together:

1) Auto-setting "value" of data-model elements from component data

2) Fixing bug where select element without a blank doesn't sync value back to component

Fixing a few model-related rendering bugs

A) Only re-set values after re-render for models that have fully changed,
not just fields that have been modified (but show value may not be synced
back to the value store yet)

B) When setting the value property on an input, skip any models that we
know are in an unsynced state (i.e. we know they have a field that has
changed, but the value hasn't been set onto the value store yet)
@weaverryan weaverryan marked this pull request as ready for review September 27, 2022 14:41
@weaverryan weaverryan merged commit d5d8252 into symfony:2.x Sep 27, 2022
@weaverryan weaverryan changed the title [Waiting][Live] Doc'ing how to set values via Js, select sync bug & auto-setting data-model values [Live] Doc'ing how to set values via Js, select sync bug & auto-setting data-model values Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Live][RFC] Auto-set field values to data-model [LiveComponent] Select list with no empty choice considered empty
1 participant