bnavetta / aurelia-polymer

Aurelia plugin to support Polymer
MIT License
18 stars 5 forks source link

Why only listen to 'change' and 'notify' and not 'PROPNAME-changed'? #22

Closed slundberg closed 7 years ago

slundberg commented 7 years ago

In the docs it appears as though any Polymer element property with notify set to true should be available for two-way data binding. However polymer-aurelia only listens to change and notify events. Which, while triggered on basic form elements (like paper-input) are not triggered for lots of other web components.

I added PROPNAME-changed to the list of events used by polymer-aurelia and things started working as expected. Should this be a PR?

slundberg commented 7 years ago

Any thoughts? I am happy to send a simple PR if it is helpful.

bnavetta commented 7 years ago

Sorry for the delay - must've gotten lost in my inbox. I've been meaning to add some kind of configuration mechanism for other events, like the current hardcoded IronSelectableBehavior support, but if they follow a PROPNAME-changed pattern, even better. A PR would be incredibly helpful, thank you!

slundberg commented 7 years ago

So it looks like the compiled files are also in git and the build didn't work for me the first time around. So I'll just post the tiny change here instead:

index.js line 12 is currently

      propertyConfig[propName] = ['change', 'input'];

and should be

      propertyConfig[propName] = [propName+'-changed', 'input'];

to catch events from custom objects.

bnavetta commented 7 years ago

Just pushed a commit with the change, thanks! Yeah, committing built files like that isn't ideal, but I'm not sure how else to distribute ES6 libraries portably these days.

slundberg commented 7 years ago

Thanks!

On Mon, Aug 22, 2016 at 8:50 PM Ben Navetta notifications@github.com wrote:

Closed #22 https://github.com/roguePanda/aurelia-polymer/issues/22.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/roguePanda/aurelia-polymer/issues/22#event-763935732, or mute the thread https://github.com/notifications/unsubscribe-auth/ADkTxSOLTXXO4uiozqQCP4peOoFNXTZCks5qim35gaJpZM4JheZw .