You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documents JavaScript events for subform field interactions
Describes five events: subform-row-add, joomla:updated, subform-row-remove, joomla:removed, subform-order-changed
Clarifies event targets and CustomEvent detail properties
Notes that all events bubble up in DOM
Diagram Walkthrough
flowchart LR
A["Subform Field"] -->|"row added"| B["subform-row-add event"]
A -->|"row added"| C["joomla:updated event"]
A -->|"row removed"| D["subform-row-remove event"]
A -->|"row removed"| E["joomla:removed event"]
A -->|"order changed"| F["subform-order-changed event"]
B -->|"bubbles up"| G["DOM"]
C -->|"bubbles up"| G
D -->|"bubbles up"| G
E -->|"bubbles up"| G
F -->|"bubbles up"| G
Loading
File Walkthrough
Relevant files
Documentation
subform.md
Add comprehensive subform field events documentation
The documentation introduces paired events for adding and removing subform rows (subform-row-add/joomla:updated and subform-row-remove/joomla:removed). This could be confusing; the documentation should clarify the relationship between these events and provide guidance on their intended use cases.
-`subform-row-add` Event dispatched after new row has been added. Target: subform element. CustomEvent detail property contain affected row: `detail.row`.
-`joomla:updated` Event dispatched after new row has been added. Target: affected row element.
-`subform-row-remove` Event dispatched before removing the row. Target: subform element. CustomEvent detail property contain affected row: `detail.row`.
-`joomla:removed` Event dispatched before removing the row. Target: affected row element.
Solution Walkthrough:
Before:
-`subform-row-add` Event dispatched after new row has been added. Target: subform element. CustomEvent detail property contain affected row: `detail.row`.
-`joomla:updated` Event dispatched after new row has been added. Target: affected row element.
-`subform-row-remove` Event dispatched before removing the row. Target: subform element. CustomEvent detail property contain affected row: `detail.row`.
-`joomla:removed` Event dispatched before removing the row. Target: affected row element.
...
All events are bubbles up in DOM.
After:
When a row is added, two events are fired:
-`subform-row-add`: Fired on the main subform element. Use this when you need to react to any row addition within the subform. The added row is in `event.detail.row`.
-`joomla:updated`: Fired on the newly added row element itself. This is a more generic Joomla event.
Similarly, when a row is removed:
-`subform-row-remove`: Fired on the main subform element. The row to be removed is in `event.detail.row`.
-`joomla:removed`: Fired on the row element that is about to be removed.
**Guidance:** Prefer using the `subform-row-*` events for subform-specific logic as they are more explicit and provide context via `event.detail`. Both event types bubble up the DOM.
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies a potential point of confusion in the new documentation regarding paired events and proposes a valuable clarification that would significantly improve usability for developers.
Medium
General
Fix detail property grammar
Correct the grammar in the CustomEvent detail property description.
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 4
__
Why: The suggestion correctly identifies and fixes a grammatical error ("contain" to "contains") in the documentation, which improves its quality and professionalism.
Low
Fix event bubbling grammar
Correct the grammar in the sentence describing DOM event bubbling.
-All events are bubbles up in DOM.+All events bubble up in the DOM.
Apply / Chat
Suggestion importance[1-10]: 4
__
Why: The suggestion corrects a grammatical error ("are bubbles up" to "bubble up"), improving the clarity and correctness of the documentation.
Low
More
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
PR for:
Also added info about existing events.
PR Type
Documentation
Description
Documents JavaScript events for subform field interactions
Describes five events: subform-row-add, joomla:updated, subform-row-remove, joomla:removed, subform-order-changed
Clarifies event targets and CustomEvent detail properties
Notes that all events bubble up in DOM
Diagram Walkthrough
File Walkthrough
subform.md
Add comprehensive subform field events documentationdocs/general-concepts/forms-fields/standard-fields/subform.md
joomla:removed events
fromPosition, toPosition)
new-features.md
Document new subform-order-changed event featuremigrations/60-61/new-features.md