Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10372] TiAPI: event system: Bubble architecture

GitHub Issuen/a
TypeSub-task
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-10-29T19:15:15.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.1.0, 2012 Sprint 22 API, 2012 Sprint 22
ComponentsTiAPI
Labelsapi
ReporterBlain Hamon
AssigneeBlain Hamon
Created2012-08-09T11:33:29.000+0000
Updated2017-03-21T18:57:01.000+0000

Description

Event bubbling is to happen in the following way: Views shall have a boolean, 'bubbleParent', (readwrite) that indicates whether or not the view will bubble up events. Internally, views, at a class level, should provide a way to indicate which view is next to receive the event. NULL is a valid response, when the view is not connected, has no parent otherwise, or is not a view that bubbles. An event shall have a boolean, 'bubbles', that is set at creation time only, that indicates if the event will bubble or not. This is to allow custom events to also bubble as well. An event shall also have a boolean, 'cancelBubble', that starts false but can be set during event handling. As such, an event bubbles if the following is true: event.bubbles && !event.cancelBubble && view.bubbleParent && ((next view to get event) is not NULL or similar) NOTE that event bubbling happens after the fact. That is, the native handling (such as indicating highlight) have already happened before any event fires. ALSO NOTE that multiple events of different types are treated separately. That is, if the user lifting their finger triggers 'touchup', 'tap', and 'click' events, any actions done on the touchup event (such as setting cancelBubble) do not affect bubbling nor firing of either tap or click. By having the spec this open and not specific, we can implement this independent of specific event specs. Sub-tasks that are for each OS will happen after this spec is approved.

Comments

  1. Bryan Hughes 2012-08-09

    I don't know if I like having 'bubbles' also be on the event object. Would the user be able to see this? It doesn't quite feel right to me for some reason.
  2. Blain Hamon 2012-08-10

    The bubbles read-only property is taken from the W3C spec and is to indicate that the event may bubble, not necessarily that it will (due to the view having nothing to bubble to, etc.)
  3. Ingo Muschenetz 2012-10-29

    TIMOB-10464 has been moved to a separate story. Going to resolve this for now.
  4. Lee Morris 2017-03-21

    Closing ticket as fixed.

JSON Source