Code Monkey home page Code Monkey logo

autogrow's People

Contributors

crisfole avatar deefour avatar johnbhall avatar robertmain avatar ultimatedelman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autogrow's Issues

Wrong height with padding

Hi,

Seems adding a padding to textarea cause resizing having wrong height value.
You'll find a test case here : http://jsfiddle.net/Akaryatrh/wfUcM/

Moreover, focus on textarea seems required to activate autogrow. Is there a way to calculate and assign height to elements when plug-in is called ?

Create a destroy method.

You've done a great job however i think its really really important to always have a destroy method available in case you need to bind and unbind such events. If you are willing to add such a feature, i am willing to submit a PR for this.

Thanks, let me know.

Function after resize

There should be an option that will take a function name as a paramenter and execute it whenever the textarea is resized.

Problem with selector?

I'm trying to use autogrow with a lot of other plugins together, but when I try to use a custom jquery selector, it doesn't work.
I created a html attribute on the textarea to control who already has autogrow and who's doesn't.

console.log($('.tarea_marcacao')); // return all textareas
console.log($('.tarea_marcacao[appliedAutogrow="false"]')); // return the same all textareas

$('.tarea_marcacao').autogrow({ //works
    onInitialize: true,
    fixMinHeight:true
});

$('.tarea_marcacao[appliedAutogrow="false"]').autogrow({ //nothing happens...
    onInitialize: true,
    fixMinHeight:true
});

I also tryed to use it inside a $.each loop, but it didn't worked too

$('.tarea_marcacao[appliedAutogrow="false"]').each(function(){
    $(this).autogrow({ //doesn't work either....
        onInitialize: true,
        fixMinHeight:true
    });
});

Thanks.

Set maxheight

Is there a way to set maxheight so it can stop growing up to some point?

Textarea not resizing after form submitted

I have an Rails app with a remote form like this

<%= form_for Message.new, remote: true do |f| %>
   <%= hidden_field_tag "room_uid", @room.uid %>
   <%= f.text_area :content, class: "chat-text-field", autocomplete: "off", autofocus: true %>
 <% end %>

when I submit this form, after typed a long text, the textarea does not back to its initial size. I'm calling autogrow with $('.chat-text-field').autogrow(); and submiting the form with

$( ".chat-text-field" ).keypress(function(data) {
      if(data.charCode == 13 && !data.shiftKey){
        $('#new_message').submit()
      }
    });

jQuery 3 compatibility - error in the resize function

We recently upgraded to jQuery 3.1.0
Now we are getting the following error when we backspace in a textbox, which is strange because we are using autogrow on textareas only.

Unable to get property 'ownerDocument' of undefined or null reference

The error happens on
clone = box.clone() //add clone class for extra css rules .addClass(opts.cloneClass) //make "invisible", remove height restriction potentially imposed by existing CSS .css({ position: 'absolute', zIndex: -10, height: '' }) //populate with content for consistent measuring .val(box.val());

Not autogrowing textarea not visble

Hi, i have a textarea into of a modal bootstrap, via js initialize this textarea with autogrow but this not auto resize, i think this happens because this texarea is visible only modal launch. Any solution to this.

Thanks.

Stops growing when approaching parent height.

I have the textarea inside of a div with a fixed height and overflow: scroll;. When the textarea approaches the height of the parent div (about one line height above). I can't find anywhere that seems like it will cause this problem, but wondering if you have any ideas.

I am looking for it to expand so that the div it is inside of needs to scroll to see the bottom of this.

I will try to recreate the issue in a fiddle.

Does not work with jQuery 3.x

Easy to reproduce: Use jQuery 2.x and it works fine. Switch to new jQuery 3.x release and it does not work anymore

Initially hidden textareas

First of all, thanks for the great plugin, I really love it!

Issue: if the autogrown textarea is initially hidden (say under a different Bootstrap tab that's not currently visible) its height is still adjusted and since it's not visible, empty textareas end up shrinking to nothing.

image

I believe this issue can be solved by simply not autogrowing invisible empty textareas...

Getting an error

I paste the js file in my project.
I use the $('textarea').autogrow(), but get the following error:
Uncaught TypeError: undefined is not a functionmessage-interaction.js?compile=false:21 (anonymous function) - on the autogrow function

Minimum height and select all + delete and onClick

Thanks for an awsome plugin! I have three minor issues though:

  1. fixMinHeight doesn't seem to do anything for me. I've tried with setting the row attribute and height in my markup, but those values are ignored when backspacing all to the top. The box size follows and shrinks all the way until one line remains.
  2. Select all + delete. The box remains extended.
  3. The textarea doesn't expand when clicking in it, you have to start typing. This is perhaps not an issue, but it would be nice to have it in options? (I solved it by adding .on('click', selector, resize) at line 30.)

onInitialize option not working

I have a textarea that contains a lot of text when the page initially loads. I call ...

$('textarea').autogrow({onInitialize: true})

... and it does not grow to contain the text immediately. When I click on the textarea and type something, only then does it autogrow.

textarea shrinks below initial size

If I delete all the text in a textarea, the box shrinks below it's initial size. I tried setting fixMinHeight to false as well and I am not sure what else to try. Is this supposed to happen?

Sets focus to textarea

When I run autogrow it seems to change the focus to the textarea, causing my page to immediately scroll down.

How can I prevent that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.