Skip to content

[LiveComponent] Minor docs tweaks and changelog bump #430

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

Merged
merged 1 commit into from
Aug 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/LiveComponent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# CHANGELOG

## 2.3.1
## 2.4.0

- [BC BREAK] Previously, the `id` attribute was used with `morphdom` as the
"node id" when updating the DOM after a render. This has changed to
`data-live-id`. This is useful when maintaining the correct order of a list
of elements.

- [BC BREAK] If using `LiveCollectionType`, the name of the remove field changed
from `button_delete_prototype` to `button_delete` and the add field changed
from `button_add_prototype` to `button_add`. Additionally, the `allow_add`
and `allow_delete` default values were changed from `false` to `true`.

- [BEHAVIOR CHANGE] If an action Ajax call is still processing and a
model update occurs, the component will _no_ longer re-render. The
model will be updated internally, but not re-rendered (so, any
Expand Down
12 changes: 6 additions & 6 deletions src/LiveComponent/src/Resources/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ and ``live_collection_button_delete`` block prefix respectively:
{{ block('button_widget') }}
{% endblock live_collection_button_add_widget %}

If you only want to customize some attributes maybe simpler to use the options in the form type:
If you only want to customize some attributes, it maybe simpler to use the options in the form type:

// ...
->add('comments', LiveCollectionType::class, [
Expand All @@ -1301,12 +1301,12 @@ If you only want to customize some attributes maybe simpler to use the options i
// ...

If you want more control over how each row is rendered you can override the blocks
related to the ``LiveCollectionType``. This works the same way as for `the traditional
collection type`_, but you should use ``live_collection_*`` and ``live_collection_entry_*``
as prefixes instead.
related to the ``LiveCollectionType``. This works the same way as
`the traditional collection type`_, but you should use ``live_collection_*``
and ``live_collection_entry_*`` as prefixes instead.

For example, let's continue our previous example and customize the rendering of the blog post comments form.
By default the add comment button is placed after the comments, let's move it before them.
By default, the add comment button is placed after the comments. Let's move it before them.

.. code-block:: twig

Expand Down Expand Up @@ -1339,7 +1339,7 @@ Now add a div around each row:
collection view variables and a ``button_delete`` is added to each
item view variables.

As an another example, now let's create a general bootstrap 5 theme for the live
As another example, let's create a general bootstrap 5 theme for the live
collection type, rendering every item in a table row:

.. code-block:: twig
Expand Down