Skip to content

Commit

Permalink
DOC-2578: New onSetup function for context forms. (#3550)
Browse files Browse the repository at this point in the history
* DOC-2578: New onSetup function for context forms.

* Update modules/ROOT/pages/7.6.0-release-notes.adoc
  • Loading branch information
kemister85 authored Dec 10, 2024
1 parent 17285e3 commit e96eb4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/ROOT/pages/7.6.0-release-notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ For more information on the `+disabled+` option, see xref:editor-important-optio

// CCFR here.

=== New `onSetup` function for context forms
// #TINY-11494

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.

For more details, refer to xref:contextform.adoc#form[Context Form].

=== Added placeholder support for context form input fields
// #TINY-11459

Expand Down
5 changes: 5 additions & 0 deletions modules/ROOT/pages/contextform.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ This relates to the form itself. The form specifications are:
|`+position+` |This controls where the context toolbar will appear with regards to the current cursor.
|`+scope+` |This controls whether the predicate (condition) is a `+node+`-based predicate, or an `+editor+`-based predicate. See context toolbar priority for more details.
|`+commands+` |This is a list of the items to show in the context form. They can be either `+contextformbutton+` or `+contextformtogglebutton+`.
|`+onSetup+`
a|
`+(ContextFormApi) => (ContextFormApi) => void+`

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.
|===

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

0 comments on commit e96eb4f

Please sign in to comment.