-
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
dom-repeat
inside table
element is having unexpected behavior in 2.0 preview
#4135
Comments
Using With the loss of |
Interesting. Thanks. #damnApple |
This limitation basically known with the change to |
@kevinpschaaf this is horrible. Have you argued this case to get the "is" attribute accepted by everybody? |
Maybe if the other browser vendors knew the lengths people have to go to now that extending builtin elements is gone, they might change how they feel about |
how will on this bug be worked on? will polymer build it's own "is" mechanism? |
Will this mean that Polymer will reccomend two distinct syntaxes for Dom helper elements going forward? A shimmed is extension for cases like this (transformed with a pointer) and the 'regular' custom element wrappers for all other scenarios? |
In this case we already have access to the custom element |
And lose the default rendering of the |
I have not looked in a while, but isn't the default rendering pretty primitive and non-standard across browsers anyways? |
It seems like a better choice to leave iteration to a higher-level view layer, and leave HTML/DOM strictly for content. We could, for example, use a handlebars loop to render the stuff in the tbody rather than using dom-repeat which gets in the way of the DOM content. |
or we add a attribute to dom repeat ("targetId"), if unset we use our own shadow dom, if set we use the target |
Or 2 separate elements. Use |
@oleersoy I was not reffering to style strictly, but to all Also take the |
@trusktr I couldn't agree more! But would that be out of the spec's scope? It would be charming to the spec address this issue. |
@reinert I see what you mean. Lets assume we have it in the specs scope right now agreed to by both Apple and MS. Now we have to document that So if the current solution that @kevinpschaaf noted turns out being equally performant and easy to use, which it sounds like it will, we get the iteration you are looking for and someone gets to skip writing the explanation noting when to use what. |
@reinert I think @trusktr is suggesting (correct me if I'm wrong) using a dedicated templating layer (eg: handlebars) on top of Polymer. Or, in other words, just don't use web components for this kind of thing. This seems pretty heavy handed to me, especially since with the extra js dep we could just carry the polyfill for type extension on webkit and have the old behaviour back across the board. It looks like Mozilla and Edge are implementing is="", so you would only be polyfilling on Safari. |
I have to agree that the whole thing does seem heavy handed. We are building a bridge to get around the spec / html schema, so if the spec / schema was relaxed the problem goes away. Shouldn't we be asking browser vendors to do this? |
Yeah, heavy handed. For now, better to stick with the "is" attribute and use the polyfill for safari only. |
@reinert and others that care to follow, there's a long and intricate ongoing debate on supporting type extension as per the v1 spec at WICG/webcomponents#509. If you'd like to see it supported by vendors that's the best place to argue the case. |
We should really:
@reinert it's heavy handed, but only because we have a html schema that forces a heavy handed technique. So by advocating the usage of Assuming the schema restriction is removed and we fast forward ten years we no longer need |
True. By relaxing the schema this problem would be solved in a simpler way (and probably many others). |
You can argue it both ways. This is just one of many use cases where type extension solves a very real problem. |
Relaxing schema is NOT a simpler way, it just introduce more problems because it breaks mental model of developers about tables/ol/ul/dl etc. |
The good news is... that we've decided to continue supporting This has a couple of practical benefits that outweigh the otherwise uncanny usage of
Note that any main-document use of |
cc @arthurevans FYI, might be some relevant detail here for docs. |
I'm confused at the 'closed' status of this issue. It appears that a 'decision' was made - which sounds very promising. However, with no mention of a fix being made I'm left wondering what happened? Are we still waiting for a fix or is there a version somewhere with this working that we can test? |
@kevinpschaaf's comment mentions I believe he is implying that you are to use the In other words, I think he means: "we support the attribute form of dom-repeat for those cases, not the element form, so no fix is needed for the element form and don't use element form for those cases". |
@gechols Yes, @trusktr is correct. Just use Working on Release Candidate docs now, where we will clarify that this is the recommended path. |
Ah - I see that the latest 2.0-preview has several fixes in it. This is what I was missing. My tables are starting to look much better now! I can't wait to start seeing the RC versions come out. Thanks for all the hard work on the new version. |
Yes, but the docs say also, that this autowrapping might be removed in the feature! |
When we set a
dom-repeat
inside atable
element, it presents the content outside thetable
.But if we instead use the former syntax
template is="dom-repeat"
, it works as expected.Maybe related to #3919.
The text was updated successfully, but these errors were encountered: