Right now we are using the same names as native events. This is causing issues with event bubbling and we think it is confusing that we don't differentiate between what a native event is and what our custom events are. Also, there are times we override the native events which isn't good.
We're going to rename all custom events so they begin with ion, so where we have:
<ion-tabs (change)="onChange($event)">
it will be
<ion-tabs (ionChange)="tabsChange($event)">
Can we prepend with the component name instead? (tabChange) vs (ionChange)
@mlynch Updated the issue to reflect the change to component names instead of ion.
List of event name changes:
change -> ionChangechange -> ionChangecancel -> ionCancel infinite -> ionInfiniteopening -> ionDragopened -> ionOpenclosed -> ionCloseselect -> ionSelectchange -> ionChangeselect -> ionSelectchange -> ionChangerefresh -> ionRefreshpulling -> ionPullstart -> ionStartinput -> ionInputblur -> ionBlurfocus -> ionFocuscancel -> ionCancelclear -> ionClearchange -> ionChangeselect -> ionSelectchange -> ionChangecancel -> ionCancelwillChange -> ionWillChangedidChange -> ionDidChangemove -> ionDragselect -> ionSelectselect -> ionSelectchange -> ionChangechange -> ionChangeFor menus, let's rename them to menuOpen and menuClose. I think they had ed at the end so it wasn't stepping on something else to begin with.
For Platform let's not rename them since they're not on an element and wouldn't bubble up.
Can't say infiniteScrollLoading is overly awesome, but for consistency reasons it makes sense.
Overall looks good to go 馃憤
Actually, should we have menuWillOpen, menuDidOpen and menuWillClose, menuDidClose?
What about infiniteScrollStart similar to refresher? We could have menuDidOpen and menuDidClose but we would have to add events for the others. Not a bad idea actually.
We decided to go back to using ion instead of the component name, since this API is easier because the user doesn't have to look up each event name to know which one to use.
Most helpful comment
We decided to go back to using
ioninstead of the component name, since this API is easier because the user doesn't have to look up each event name to know which one to use.