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

Popup width is not updated automatically when content changes

Open plcarmel opened this issue 9 years ago • 2 comments

In my app, when the user clicks on a marker, a promise needs to be resolved before the popup content is rendered by Ember.

The problem is that the width seems to be computed only once (at the time the popup opens) and the popup ends-up being not wide enough for the content.

Any idea how to fix this ?

plcarmel avatar Dec 14 '15 18:12 plcarmel

I circumvented the problem this way:

I had this:

{{#marker-layer}}
  {{someObject.somePromiseObject.someProperty}}
{{/marker-layer}}

Changed it to:

{{#marker-layer}}
  {{some-component someObject=someObject}}
{{/marker-layer}}

with templates/components/some-component.hbs:

  {{someObject.somePromiseObject.someProperty}}

and components/some-component.js:

import Ember from 'ember';
export default Ember.Component.extend({
  onDidUpdate: Ember.on('didUpdate', function() {
    this.get('parentView._popup').update();
  })
});

It works but it would be nice if it could be made built-in. Any idea on how to do this ?

plcarmel avatar Dec 14 '15 18:12 plcarmel

Yes, the trick here is calling update on the popup layer. AFAIK, an automated way of doing this isn't possible. :/

Any ideas?

miguelcobain avatar Jan 27 '16 14:01 miguelcobain