Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TextAreaItem scrolls to top on focusLost after being modified

    Currently using:
    SmartGWT 3.1p as of date 01/30-2013

    We have found an issue with the TextAreaItem component where the following occurs:

    1) In a TextAreaItem widget which shows scrollbars, scroll down to the bottom of the document in the widget.
    2) Enter some text/make changes to the text.
    3) Click outside of the TextAreaItem widget.

    Issue: When user clicks outside, the TextAreaItem scrolls to the very top of the document.

    This causes headache for our end users since they have to repeatedly scroll down to the area where they were last.

    Note: If user scrolls down, clicks inside the TextAreaItem, but does not change the document, and then clicks outside, then the TextAreaItem does not scroll to the top. Only when the user modifies the document shown does the TextAreaItem scroll to the top.


    The following EntryPoint module code shows the issue.

    Code:
    package test.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;
    
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.TextAreaItem;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class TestEntryPoint implements EntryPoint
    {
      /**
       * This is the entry point method.
       */
      @Override
      public void onModuleLoad()
      {
        TextAreaItem textAreaItem = new TextAreaItem();
        textAreaItem.setTitle("TextArea"); //$NON-NLS-1$
        textAreaItem.setValue(getDocument());
    
        DynamicForm df = new DynamicForm();
        df.setFields(textAreaItem);
    
        VLayout mainLayout = new VLayout();
        mainLayout.addMember(df);
    
        RootPanel.get().add(mainLayout);
      }
    
      /**
       * @return
       */
      private String getDocument()
      {
        return "1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n";
      }
    }
    Attached Files
    Last edited by jornn; 12 Feb 2013, 12:00.

    #2
    Get rid of your RootPanel.add() call and just use draw(). Using RootPanel.add() can cause core GWT to become involved in event processing inappropriately.

    Comment


      #3
      Woa... that was a quick reply :-)

      I tried the attached code, but the same thing happens. Same behavior as the user makes changes, then clicks outside the Text Area.


      Code:
      package test.client;
      
      import com.google.gwt.core.client.EntryPoint;
      
      import com.smartgwt.client.widgets.form.DynamicForm;
      import com.smartgwt.client.widgets.form.fields.TextAreaItem;
      import com.smartgwt.client.widgets.layout.VLayout;
      
      /**
       * Entry point classes define <code>onModuleLoad()</code>.
       */
      public class TestEntryPoint implements EntryPoint
      {
        /**
         * This is the entry point method.
         */
        @Override
        public void onModuleLoad()
        {
          TextAreaItem textAreaItem = new TextAreaItem();
          textAreaItem.setTitle("TextArea"); //$NON-NLS-1$
          textAreaItem.setValue(getDocument());
      
          DynamicForm df = new DynamicForm();
          df.setFields(textAreaItem);
      
          VLayout mainLayout = new VLayout();
          mainLayout.addMember(df);
      
          mainLayout.draw();
        }
      
        /**
         * @return
         */
        private String getDocument()
        {
          return "1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n1\n2\n";
        }
      }

      Comment


        #4
        We can check this out - what browser(s) and OS are you experiencing the problem?

        Comment


          #5
          Originally posted by Isomorphic View Post
          We can check this out - what browser(s) and OS are you experiencing the problem?
          I experience it on FireFox 10, 17, 18.

          Not on IE 9, Safari, Chrome.

          My apologies for not providing this up front.

          Comment


            #6
            Any update on this issue? Any workarounds I could try?

            Comment

            Working...
            X