#4573 Autoexpanding textarea doesn't expand at the right rate in Firefox

v1.0.0
closed
nobody
42cc (432)
General
2015-08-20
2012-07-18
No

Our textareas that autoexpand (e.g. comment boxes) do not expand at the right rate in Firefox, so you can't see what you're typing when you're typing a lot. It works fine in Chrome.

We've evaluated autoexpanding javascript libraries in the past, and there are a lot of bad ones (inaccurate, performance problems, etc) so I don't want to change which library we are using. Rather, I think/hope that this can be fixed with something like changing how the CSS is applied. There is a possibility that this varies between the allura theme and the SourceForge theme.

Related

Tickets: #4255
Tickets: #4573

Discussion

1 2 > >> (Page 1 of 2)
  • Yaroslav Luzin - 2012-07-23

    created #126: [#4573] Autoexpanding textarea doesn't expand at the right rate in Firefox (2cp)

    • status: open --> in-progress
     

    Related

    Tickets: #4573

  • Anonymous - 2012-07-23

    Originally by: yuriyarhipov

    It doesn't work only in the SourceForge theme. How I can install this theme?

     
  • Yaroslav Luzin - 2012-07-26

    Closed #126, it works now on the default theme, did not test it on sftheme but should work. The fix is in 42cc_4573 branch.

    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-07-27

    Oops, I didn't specify that it was on the comment box that appears when you edit a ticket. That is where it is the worst. That box seems narrower than the regular comment box. Can you fix that too?

    I tried the regular comment box again now, and actually can't duplicate an autoexpand problem there, so I'm not sure if that needs to be changed? You found an issue with it though. One problem with the changes so far is that on the 'sftheme' theme, the right side of text boxes are cut off. So we need to either tweak that, or not make those changes (if they aren't necessary)

     
  • Dave Brondsema

    Dave Brondsema - 2012-07-27
    • status: code-review --> open
     
  • Yaroslav Luzin - 2012-07-30

    created #136: [#4573] Autoexpanding textarea doesn't expand when editing a ticket (1cp)

    • status: open --> in-progress
     

    Related

    Tickets: #4573

  • Dave Brondsema

    Dave Brondsema - 2012-08-01

    Replies to comments also exhibit this behavior. It probably gets worse when you're a replying to a reply, etc, and the textarea is indented more.

     
  • Yaroslav Luzin - 2012-08-06

    closed #136, pushed changes into 42cc_4573

    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-08-06
    • qa: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2012-08-06
    • status: code-review --> in-progress
     
  • Dave Brondsema

    Dave Brondsema - 2012-08-06

    I don't see any new commits for 4573 on the 42cc_4573 branch. There is an 4270 commit that shouldn't be there though.

     
  • Yaroslav Luzin - 2012-08-07

    That commit was exactly for #4573, sorry, marked it incorrectly. I renamed it and force pushed back into 42cc_4573.

     
  • Yaroslav Luzin - 2012-08-07
    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-08-09

    Replying to a nested comment works now, but its still bad when editing a ticket and putting a lot of text in that comment box (in both themes)

    Since this is taking a couple of tries, and it's a tricky issue, I'd like make sure we end up with very clean changes at the end. Can you remove any unnecessary changes, and add comments to the remaining changed line(s) so that future developers can know why that bit of code is so important? Thanks

     
  • Dave Brondsema

    Dave Brondsema - 2012-08-09
    • status: code-review --> open
     
  • Yaroslav Luzin - 2012-08-10
    • status: open --> in-progress
     
  • Yaroslav Luzin - 2012-08-10

    created #147: [#4573] Still bad when editing a ticket and putting a lot of text in that comment box (1cp)

     

    Related

    Tickets: #4573

  • Anonymous - 2012-08-15

    Originally by: yuriyarhipov

    I fixed last bug but I found another bugs in jQuery plugin. I've found a very good plugin http://www.jacklmoore.com/autosize
    It is faster than elastic and doesn't have performance problems.
    It works very well

    diff --git a/Allura/allura/lib/widgets/form_fields.py b/Allura/allura/lib/widgets/form_fields.py
    index 099b0d9..6424562 100644
    --- a/Allura/allura/lib/widgets/form_fields.py
    +++ b/Allura/allura/lib/widgets/form_fields.py
    @@ -190,11 +190,9 @@ class AutoResizeTextarea(ew.TextArea):
             css_class='auto_resize')
    
         def resources(self):
    -        yield ew.JSLink('js/jquery.elastic.js')
    +        yield ew.JSLink('js/jquery.autosize-min.js')
             yield onready('''
    -            $('textarea.auto_resize').elastic().focus(function(){
    -                $(this).keyup();
    -            });
    +            $('textarea.auto_resize').focus(function(){$(this).autosize();});
             ''')
    
    diff --git a/ForgeWiki/forgewiki/templates/wiki/page_edit.html b/ForgeWiki/forgewiki/templates/wiki/page_edit.html
    index 70e0398..224cdda 100644
    --- a/ForgeWiki/forgewiki/templates/wiki/page_edit.html
    +++ b/ForgeWiki/forgewiki/templates/wiki/page_edit.html
    @@ -51,6 +51,7 @@
     {% block wiki_extra_js %}
     <script type="text/javascript">
       /*<![CDATA[*/
    +  $('textarea.auto_resize').autosize();
       $('span.removable').click(function(e){
         var vals = $('#page_edit_form').serialize();
         var del_name = $('input', this)[0].name.replace('.id','.delete');
    
     
  • Yaroslav Luzin - 2012-08-17

    closed #147, branch - 42cc_4573

    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-08-27
     
  • Dave Brondsema

    Dave Brondsema - 2012-08-27
    • when I click on 'reply' (on a ticket's comment if it matters) I briefly see a new textarea appear but then the page reloads. This is a new bug introduced somehow.
    • Allura/allura/lib/widgets/discuss.py has a reference to elastic.
    • Need to address my prior comment: "Since this is taking a couple of tries, and it's a tricky issue, I'd like make sure we end up with very clean changes at the end. Can you remove any unnecessary changes, and add comments to the remaining changed line(s) so that future developers can know why that bit of code is so important? Thanks" A perfect example is in the new line that sets width -50. We should explain what the 50 relates to.

    • status: code-review --> in-progress

     
  • Yaroslav Luzin - 2012-08-28

    I created #155: Fix the branch, clean changes and make sure eveything works right (1cp).

    I guess we'll better create a fresh new branch and cherry pick the commits with proper comments.

     
  • Yaroslav Luzin - 2012-08-30

    closed #155, branch - 42cc_4573a

    • status: in-progress --> code-review
     
  • Anonymous - 2012-08-30

    Originally by: yuriyarhipov

    refresh textarea height in a wiki page

    ~~~~~~~~~~~~~~~~~~~~~~
    diff --git a/ForgeWiki/forgewiki/templates/wiki/page_edit.html b/ForgeWiki/forgewiki/templates/wiki/page_edit.html
    index 70e0398..224cdda 100644
    --- a/ForgeWiki/forgewiki/templates/wiki/page_edit.html
    +++ b/ForgeWiki/forgewiki/templates/wiki/page_edit.html
    @@ -51,6 +51,7 @@
    {% block wiki_extra_js %}
    <script type="text/javascript">
    /*<![CDATA[*/
    + $('textarea.auto_resize').autosize();
    $('span.removable').click(function(e){
    var vals = $('#page_edit_form').serialize();
    var del_name = $('input', this)[0]
    .name.replace('.id','.delete');

     
  • Dave Brondsema

    Dave Brondsema - 2012-09-05

    I am going to merge this branch since it is working quite well, especially in Firefox. However, I would like a little more testing. In Safari, Chrome, and IE, the textarea doesn't expand quite far enough. For extra line, the textarea grows by about 95% of a line height, so eventually the top line is only partially visible, and then with even more text typed into the box, whole lines are not visible at the top. Example: http://screencast.com/t/qWoyw1pbvrUM At least the text is hidden at the top of the textarea and not the bottom where you're typing :) If this can be fixed easily (e.g. an hour or so of research) let's do that. If its taking longer than that, we'll leave it as-is. It's good enough.

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.