Skip to content

Initialise on keydown? #51

@domchristie

Description

@domchristie

Re: #50 Could we auto-initialise the plugin on keydown rather than on DOM ready? Something like:

$(document).on('keydown.expanding', 'textarea.expanding', function() {
  var $this = $(this);
  if (!$this.expanding('initialized')) {
    $this.expanding();

    // Prevent `keydown.expanding` from firing on this textarea(?)
    $this.off('keydown.expanding'); 
  }
});

I’m no sure off would work, but this might solve issues with .expanding textareas that are inserted into the DOM. Just a thought.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions