ember-datepicker icon indicating copy to clipboard operation
ember-datepicker copied to clipboard

'container' option

Open kevinansfield opened this issue 10 years ago • 0 comments

I recently had a need to have pikaday render into a specified element. Pikaday has a 'container' option for this but ember-datepicker doesn't pass it through.

When adding it to the list of passed-through options I ran into two issues:

  1. 'container' seems to be a reserved word in ember
  2. Pikaday only accepts a plain element which is difficult to pass through as in most cases the element you want to pass through won't have been rendered when the component is being initialised

To solve the above I added a 'containerElement' option that also accepts a selector string so that we can use jQuery to grab the element in the component's didInsertElement hook: https://github.com/kevinansfield/ember-datepicker/blob/container-param-selector/addon/components/date-picker.js#L81

If you think it would be a useful addition I'll add some acceptance tests and make a pull request.

kevinansfield avatar Feb 04 '15 18:02 kevinansfield