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

Layout not rendering correctly when using template inclusion #37

Open
jaypanares opened this issue Jul 14, 2015 · 3 comments
Open

Layout not rendering correctly when using template inclusion #37

jaypanares opened this issue Jul 14, 2015 · 3 comments

Comments

@jaypanares
Copy link

Hi, seemed to have found a bug. In my example below, I am using another template within grids/columns, but it doesn't render correctly (not middle and center aligned). If I render the template without any other templates (just the whole html code), it renders correctly.

http://meteorpad.com/pad/Js9KZ6Dbf9nEo2Xdz/Semantic%202.0

Try running the code with the {{> loginForm}} template first, then try running again replacing {{> loginForm}} with the html it's supposed to be loading.

Using the latest semantic:ui with 2.0

Thanks!

@jaypanares
Copy link
Author

Looks like in the class="ui middle aligned center aligned grid" the duplicate aligned gets merged into one, so it gets rendered like so: class="ui middle aligned center grid"

Is this a Meteor thing?

@bitIO
Copy link

bitIO commented Nov 8, 2015

It also happens if you use something like two column computer one column mobile grid. It might be related to how meteor set classes (I haven't dig into that). To make it work you need to add classes via plain js or something like that. Just a workaround.

EDIT: Just forgot to mention that this also happens with css version of semantic so, I guess is more a blaze issue rather than Semantic.

EDIT 2: After some research, I've found the problem and opened and issue here meteor/meteor#5632

@nooitaf nooitaf closed this as completed Mar 5, 2017
@nooitaf
Copy link
Member

nooitaf commented Mar 7, 2017

sorry about closing this so quickly, i thought it got "fixed" :P


Meteor removes duplicates because of the HTML5 spec. meteor/blaze#30

Consensus seems to be that SUI should be patched instead of Meteor or Blaze.

Here is an interesting solution from @arggh Semantic-Org/Semantic-UI#1526 (comment)

<template name="div">
  <div>
    {{> Template.contentBlock}}
  </div>
</template>
Template.div.onRendered(function() {
  $(this.firstNode).get(0).className = this.data.class;
});

How to use:

<div class="ui grid">
   {{#div class="sixteen wide mobile twelve wide tablet ten wide computer column"}}
      <!-- column content -->
   {{/div}}
</div>

This info and example should be in the readme. Till that's done i'll reopen this.

@nooitaf nooitaf reopened this Mar 7, 2017
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

3 participants