RSSchermer / ember-rl-dropdown

Dropdown components and mixin for Ember.
MIT License
15 stars 12 forks source link

Why event.stopPropagation? #12

Closed samselikoff closed 9 years ago

samselikoff commented 9 years ago

I wanted to put a file upload label in my dropdown list

{{#rl-dropdown tagName="ul"}}
  <li class='rl-dropdown-item'>
    <label>
      Upload new video
      <input type="file" style="visibility: hidden">
    </label>
  </li>
  ...

but this wasn't working because rl-dropdown doesn't propagate events. I had to copy + paste rl-dropdown into my project + remove this line to get it working.

Do you recall why?

RSSchermer commented 9 years ago

The reasons for that line were #2 and #4. In hindsight though, I think flat out prevention of event propagation may not be the right solution. I think the solution is to make it configurable with a propagateClicks attribute. The question is, should the default value be true or false. I think I'd personally prefer true as the default, even though that would be a minor BC break.

@gutschik thoughts?

samselikoff commented 9 years ago

Just as easy either way, I tend to prefer BC but up to you! :)

gutschik commented 9 years ago

go ahead and BC :) In my case it would be refactored pretty quickly.

RSSchermer commented 9 years ago

Thanks for the quick feedback! I'll see if I can push out a new version tonight.

RSSchermer commented 9 years ago

I just publish 0.5.0 which allows the click events on the rl-dropdown-toggle and rl-dropdown components to propagate by default. Propagation can be prevented by setting propagateClicks to false on either or both components.