-
Notifications
You must be signed in to change notification settings - Fork 2k
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
this.shadowRoot.querySelector('#'+idname) not work when i use dom-repeat #5144
Comments
The connectedCallback() {
super.connectedCallback();
Polymer.RenderStatus.afterNextRender(this, () => {
console.log(this.shadowRoot.querySelector('#' + this.tabs[0].id));
});
} You can also invoke the render method on the |
it works ,thank you ! |
i have another question, as the code that i just commented,i can bind a id_name({{item.id}} ) to the element's attribute id inside dom-repeat and it actually worked.But when i wanted to bind the class_name to the element's attribute class inside dom-repeat and it did not work,why? thank you for reply! |
Some of the native attributes, including |
thank you very much |
In the future, it is better to ask such questions in the Slack channel. I think you can close this issue now. |
Thanks @web-padawan for responding so quickly 😄 Closing per #5144 (comment) |
thanks |
hello:
i encountered a problem when i user dom-repeat in my code,as below:
<template is="dom-repeat" items="{{tabs}}">
<span id="{{item.id}}">{{item.name}}</span>
</template>
and
static get properties() {
return {tabs:{type: Array,value() {return [{ id:"style_ctrl_id",name:"style",active:'active',},{id:"data_ctrl_id",name:"data",active:'',} ];}} };}
and
connectedCallback() {
super.connectedCallback();
console.log(this.shadowRoot.querySelector('#'+this.tabs[0].id));
}`
the problem is : print null on the console panel,
i can't find the reason , thanks !
The text was updated successfully, but these errors were encountered: