Skip to content

Commit e96eb4f

Browse files
authored
DOC-2578: New onSetup function for context forms. (#3550)
* DOC-2578: New onSetup function for context forms. * Update modules/ROOT/pages/7.6.0-release-notes.adoc
1 parent 17285e3 commit e96eb4f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

modules/ROOT/pages/7.6.0-release-notes.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,13 @@ For more information on the `+disabled+` option, see xref:editor-important-optio
297297

298298
// CCFR here.
299299

300+
=== New `onSetup` function for context forms
301+
// #TINY-11494
302+
303+
A new `+onSetup+` API has been introduced for context forms, enabling integrators to execute a function when the form is rendered and handle cleanup when it is closed. This enhancement addresses the previous limitation of not being able to detect or trigger actions during the lifecycle of context forms. The `+onSetup+` API streamlines lifecycle management by supporting initialization at form rendering and providing a return function for cleanup, enhancing integration with plugins and applications.
304+
305+
For more details, refer to xref:contextform.adoc#form[Context Form].
306+
300307
=== Added placeholder support for context form input fields
301308
// #TINY-11459
302309

modules/ROOT/pages/contextform.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ This relates to the form itself. The form specifications are:
4646
|`+position+` |This controls where the context toolbar will appear with regards to the current cursor.
4747
|`+scope+` |This controls whether the predicate (condition) is a `+node+`-based predicate, or an `+editor+`-based predicate. See context toolbar priority for more details.
4848
|`+commands+` |This is a list of the items to show in the context form. They can be either `+contextformbutton+` or `+contextformtogglebutton+`.
49+
|`+onSetup+`
50+
a|
51+
`+(ContextFormApi) => (ContextFormApi) => void+`
52+
53+
Optional default: `+() => () => {}+` - Function that's executed when the form is rendered. Once rendered It returns a function that is executed when the context form is closed.
4954
|===
5055

5156
include::partial$context/positioning.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)