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

elementId issue binding to an immutable computed property #10728

Closed
alexdiliberto opened this issue Mar 25, 2015 · 5 comments
Closed

elementId issue binding to an immutable computed property #10728

alexdiliberto opened this issue Mar 25, 2015 · 5 comments

Comments

@alexdiliberto
Copy link
Contributor

The following JSBin is on beta:

http://emberjs.jsbin.com/temiji/2/edit

I would expect something like this to work but the component's final id in the DOM is actually being injected into the as to toString'd version of the computed property.

id="[object Object]"

If I bind elementId directly to a "String" literal it will work.

@alexdiliberto alexdiliberto changed the title elementId issue binding to an unmutable computed property elementId issue binding to an immutable computed property Mar 25, 2015
@alexdiliberto
Copy link
Contributor Author

Also for more context, This issue occurs in v1.10 as well.

I updated the example to be v1.9.1 compatible...then it will simply ignore my CP and use the auto-generated id

http://emberjs.jsbin.com/puraqu/1/edit

@rwjblue
Copy link
Member

rwjblue commented Mar 26, 2015

Seems like this may be a duplicate of #10607 (which should have been fixed by #10613). Can you confirm/deny?

@alexdiliberto
Copy link
Contributor Author

I don't think that one fixes this. I also tested this on beta/canary (first JSBin)

@rwjblue Some weird behavior also when I explicitly pass in the id vs set the elementId on the component http://emberjs.jsbin.com/temiji/5/edit?html,js,output

Really what I'm trying to achieve is an ID set using a CP though

@rwjblue
Copy link
Member

rwjblue commented Mar 26, 2015

I'm not seeing where this was ever supported (I could be wrong). We assume that calling this.elementId will return a plain string in many many places.

I believe that this isn't a bug/regression, but simply something that we do not support. I'd be in favor of documenting that explicitly in the API docs (around here).

The following JSBin shows a way to get a dynamic value for elementId: http://emberjs.jsbin.com/wirahi/1/edit?html,js,output

@rwjblue
Copy link
Member

rwjblue commented Mar 26, 2015

Closing now, as I think my last comment addresses things, but if you can show me where this once worked (which would make this a regression) I'm happy to reopen...

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

No branches or pull requests

2 participants