Skip to content

Prepend ion to every custom event emitted #6568

Closed

Description

@brandyscarney

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)">

Activity

  1. added this to the 2.0.0-beta.8 milestone on May 18, 2016
  2. mlynch commented on May 20, 2016

    @mlynch
    Contributor

    Can we prepend with the component name instead? (tabChange) vs (ionChange)

  3. changed the title [-]Prepend "ion" to every custom event emitted[/-] [+]Prepend component name to every custom event emitted[/+] on May 20, 2016
  4. brandyscarney commented on May 20, 2016

    @brandyscarney
    MemberAuthor

    @mlynch Updated the issue to reflect the change to component names instead of ion.

  5. brandyscarney commented on May 21, 2016

    @brandyscarney
    MemberAuthor

    List of event name changes:

    • Checkbox
      • change -> ionChange
    • DateTime
      • change -> ionChange
      • cancel -> ionCancel
    • InfiniteScroll
      • infinite -> ionInfinite
    • Menu
      • opening -> ionDrag
      • opened -> ionOpen
      • closed -> ionClose
    • Option
      • select -> ionSelect
    • Picker
      • change -> ionChange
    • RadioButton
      • select -> ionSelect
    • RadioGroup
      • change -> ionChange
    • Refresher
      • refresh -> ionRefresh
      • pulling -> ionPull
      • start -> ionStart
    • Searchbar
      • input -> ionInput
      • blur -> ionBlur
      • focus -> ionFocus
      • cancel -> ionCancel
      • clear -> ionClear
    • Segment
      • change -> ionChange
      • select -> ionSelect
    • Select
      • change -> ionChange
      • cancel -> ionCancel
    • Slides
      • willChange -> ionWillChange
      • didChange -> ionDidChange
      • move -> ionDrag
    • TabButton
      • select -> ionSelect
    • Tab
      • select -> ionSelect
    • Tabs
      • change -> ionChange
    • Toggle
      • change -> ionChange
  6. adamdbradley commented on May 21, 2016

    @adamdbradley
    Contributor

    For 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 👍

  7. adamdbradley commented on May 21, 2016

    @adamdbradley
    Contributor

    Actually, should we have menuWillOpen, menuDidOpen and menuWillClose, menuDidClose?

  8. brandyscarney commented on May 21, 2016

    @brandyscarney
    MemberAuthor

    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.

  9. changed the title [-]Prepend component name to every custom event emitted[/-] [+]Prepend ion to every custom event emitted[/+] on May 31, 2016
  10. brandyscarney commented on May 31, 2016

    @brandyscarney
    MemberAuthor

    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.

  11. locked and limited conversation to collaborators on Sep 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions