Ticketfly/ember-hook

possible breaking version change and documentation for usage with {{input}} and {{textarea}}

Closed this issue · 3 comments

Hi,
I've been using ember-hook 1.3.1 with {{input}} helpers by following
http://emberjs.com/api/classes/Ember.Templates.helpers.html#toc_extending-code-ember-textfield-code,
i.e. doing

Ember.TextField.reopen({
  attributeBindings: ['data-test'],
});

in an initializer, and then doing {{input data-helper=(hook "myTextField")}} in my templates.

This does not work in 1.3.2 any longer, so maybe the version bump should indicate a breaking change (i.e. version 2.0.0)?

The workaround that is maybe worth documenting in your README is now to simply use {{input hook=(hook "myTextField")}} in templates without any need to reopen the Ember.TextField component.

I'd say this isn't a breaking change, since manually binding data-test to a component was never documented or intended. That being said, ember-hook should already be supporting input and textarea components out-the-gate, so long as you:

{{input hook="myTextField"}}

If you're using ember-hook in an integration test, you'll need to manually trigger the initializer that reopens components and applied the hook mixin like so.

Let me know if this works for you and I'll add examples of ember-hook usage with input and textarea to the documentation. Thanks for reporting this!

@akatov is this still an issue for you?

Sorry, I'm not using ember-hook any more. This isn't an issue for me any more. I'll close this