IndexChangedEvent not sending correct event parameters in mx.containers.ViewStack
- Dominant language
- ActionScript
- Stars
- 380
- Forks
- 120
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/apache/royale-asjs/blob/9ee7abbaa576d9985f9314a1369e41faaa91a464/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as#L1286
This method in ViewStack is dispatching an mx.events.IndexChangedEvent with type of "change".
In the ElementWrapper.prototype.dispatchEvent method it looks like the event with type "change" or any events in org.apache.royale.events.ElementEvents.elementEvents get created as org.apache.royale.events.utils.EventUtils.createEvent(eventType) which is probably why there is missing event properties for the IndexChangedEvent.
I propose to change (no pun intended) the dispatched event in ViewStack to "childIndexChange". It appears from the flex original usage this should only be dispatched when "a component's index among a container's children has changed" where the "change" event is dispatched "an index has changed, such as when and Accordian control cchanges the displayed panel or a ViewStack changes views"
The difference isn't exactly clear to me, it seems "change" is just more general.
If this is satisfactory I will issue a PR.
Thank you for your time.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as around line 1286 and inspect the dispatched IndexChangedEvent. Read ElementWrapper.prototype.dispatchEvent and the ElementEvents handling mentioned in the issue, then compare the change and childIndexChange event semantics. Done means ViewStack dispatches the event type with the correct IndexChangedEvent properties.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100