Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popup width is not updated automatically when content changes #22

Open
plcarmel opened this issue Dec 14, 2015 · 2 comments
Open

Popup width is not updated automatically when content changes #22

plcarmel opened this issue Dec 14, 2015 · 2 comments

Comments

@plcarmel
Copy link

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
Copy link
Author

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 ?

@miguelcobain
Copy link
Owner

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

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants