Skip to content
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

DOC-2578: New onSetup function for context forms. #3550

Merged
merged 3 commits into from
Dec 10, 2024
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: 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.
kemister85 marked this conversation as resolved.
Show resolved Hide resolved
|===

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