djhi/meteor-autoform-materialize

Textarea expands height to bottom of the page as soon as key is pressed

Closed this issue · 1 comments

I have a simple comment collection described as such:

Comments.attachSchema(new SimpleSchema({
  content: {
    type: String,
    label: "Message",
    max: 2000,
    autoform: {
      afFieldInput: {
        type: "textarea"
      }
    }
  },
  // ...
}));

I display my autoform this way:

<template name="newComment">
  {{#autoForm collection="Comments" id="insertCommentForm" type="method" meteormethod="insertComment"}}
    {{> afQuickField name='content'}}
  <button type="submit" class="btn waves-effect waves-light">Post</button>
  {{/autoForm}}
</template>

I can click and get a cursor normally. But as soon as I start typing in the textarea, the field just expands fluidly but rapidly, until none of what's underneath (therefore, the "Post" button) can be seen. The scrollbar just doesn't go further down. No errors in the console, it happens both on firefox 39 and Chrome 43.

Ouch, my bad, just fixed it. Apparently my CSS was related to the issue... I use transitioner, which requires to have a 100% height on the container of iron-router's yield, and my css rule was a little too drastic:

body > div {
  height: 100%;
}

I used a #main selector instead. Works now.