From 99401c208e21c77297db25149fa3bbeb7a0afbfd Mon Sep 17 00:00:00 2001 From: omarluq Date: Thu, 15 Feb 2024 17:08:02 -0600 Subject: [PATCH 1/3] add docs for turbo stream morph action --- _source/handbook/05_streams.md | 8 ++++++++ _source/reference/streams.md | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/_source/handbook/05_streams.md b/_source/handbook/05_streams.md index 8b50944..f9a61cd 100644 --- a/_source/handbook/05_streams.md +++ b/_source/handbook/05_streams.md @@ -73,6 +73,14 @@ A Turbo Streams message is a fragment of HTML consisting of `` ele + + + + ``` diff --git a/_source/reference/streams.md b/_source/reference/streams.md index e6953fe..77002c5 100644 --- a/_source/reference/streams.md +++ b/_source/reference/streams.md @@ -91,6 +91,19 @@ Inserts the content within the template tag after the element designated by the ``` +### Morph + +Replaces the element designated by the target dom id via morph. + +```html + + + +``` +Also accepts a `data-turbo-morph-style="innerHTML"` attribute to morph the inner content of the element designated with the dom_id only. + ### Refresh Initiates a [Page Refresh](/handbook/page_refreshes) to render new content with From f87266904f8dc009ade9c299a5bd0503a7001732 Mon Sep 17 00:00:00 2001 From: omarluq Date: Sat, 17 Feb 2024 13:01:00 -0600 Subject: [PATCH 2/3] fix data-turbo-morph-style note --- _source/reference/streams.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_source/reference/streams.md b/_source/reference/streams.md index 77002c5..bf7a75d 100644 --- a/_source/reference/streams.md +++ b/_source/reference/streams.md @@ -102,7 +102,7 @@ Replaces the element designated by the target dom id via morph. ``` -Also accepts a `data-turbo-morph-style="innerHTML"` attribute to morph the inner content of the element designated with the dom_id only. +A `data-turbo-morph-style="innerHTML"` attribute can be added to element designated with the dom_id to morph its inner content only. ### Refresh From 1b2d96e82bc12c71429dd08acea03343e131a330 Mon Sep 17 00:00:00 2001 From: omarluq Date: Mon, 11 Mar 2024 23:19:05 -0500 Subject: [PATCH 3/3] update morph action inner html option --- _source/handbook/05_streams.md | 8 ++++++++ _source/reference/streams.md | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/_source/handbook/05_streams.md b/_source/handbook/05_streams.md index f9a61cd..0cfc74e 100644 --- a/_source/handbook/05_streams.md +++ b/_source/handbook/05_streams.md @@ -81,6 +81,14 @@ A Turbo Streams message is a fragment of HTML consisting of `` ele + + + + ``` diff --git a/_source/reference/streams.md b/_source/reference/streams.md index bf7a75d..b065a2b 100644 --- a/_source/reference/streams.md +++ b/_source/reference/streams.md @@ -102,7 +102,16 @@ Replaces the element designated by the target dom id via morph. ``` -A `data-turbo-morph-style="innerHTML"` attribute can be added to element designated with the dom_id to morph its inner content only. + +The `children-only` attribute can be added to the `turbo-stream` element to morph only the children of the element designated by the target dom id. + +```html + + + +``` ### Refresh