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

[Beta regression] this.elementId is null in tagless component #13627

Closed
cibernox opened this issue Jun 9, 2016 · 7 comments
Closed

[Beta regression] this.elementId is null in tagless component #13627

cibernox opened this issue Jun 9, 2016 · 7 comments

Comments

@cibernox
Copy link
Contributor

cibernox commented Jun 9, 2016

In 2.6, this.elementId called from within a tagless component returned something like ember123.
In 2.7 the same call in 2.7.0-beta.0 returns null.

Intended or a regression?

@rwjblue
Copy link
Member

rwjblue commented Jun 9, 2016

Well, it seems unintentional, but the new behavior does seem logical. Why would something without an element have an elementId? Why do extra work to calculate an elementId when it isn't going to be used?

Is this a large issue for your addons?

@cibernox
Copy link
Contributor Author

cibernox commented Jun 9, 2016

Not a big deal, it is an easy fix.
I just needed a unique identifier from which derive ids for the trigger and the content so I can relate them (since the content may be rendered in the root of the page, A11y requires some hint).
I could just as easy generate an autoincremental number myself, but since I had this.elementId I was using it, assuming that it was an identifier for the component, regardless of if the component had a DOM element or not.

I will stop relying on it, but I wanted to raise this change.

@rwjblue
Copy link
Member

rwjblue commented Jun 9, 2016

Thank you for reporting.

I will check with others to see if we should bring it back or try and do a deprecation. I'm unsure how big of an issue it is for others though...

@rwjblue
Copy link
Member

rwjblue commented Jun 19, 2016

Thank you again for reporting the issue. If we have significant reports of this in future releases we can revisit, but for now I'm going to close...

@jmacqueen
Copy link

Add me to list as missing this ability. Building in accessibility relationships in tagless components was much easier with it!

@bigtone1284
Copy link

was this fixed?

@alias-mac
Copy link

Just for the record (for future reference), we can use Ember.guidFor(this) to generate the id and use it in the template.

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

6 participants