Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #7629

Closed
Open
Created Aug 28, 2014 by Administrator@rootOwner

Auto-expand text area when editing comments

Created by: simonzack

The following is a userscript I've made to auto-expand text areas when editing comments, using the jquery autoresize plugin:

$(function(){
    $('.note .note_text').autosize();
    $('.new_note .note_text').autosize({
        callback: function(){
            window.scrollTo(0, $(document).height());
        }
    });
    // trigger auto-resize on edit click, not done by default since text has not been changed in the textarea
    $('.js-note-edit').on('click', function(){
        let that = this;
        setTimeout(function(){
            $(that).closest('.note').find('.note_text').trigger('autosize.resize');
        }, 0);
    });
});

I don't use coffeescript so can't do a pull request, but can this functionality be added by default? It improves usability quite a lot IMO.

Assignee
Assign to
Time tracking