4 Replies Latest reply on Nov 5, 2008 1:40 PM by Kerplunk_667

    List Scrolls when it shouldn't.

    Kerplunk_667
      I have a list of itemRenderers. Each itemRenderer is an editable text area.

      The problem is that when the user types in one of these text areas, the list sometimes auto scrolls and that textArea that the user was editing is no longer visible.

      I need to prevent this auto-scrolling, but I cant hide the scroll bar as the user needs access to all the list items.
      Any thoughts?

      Here is my idea:
      Disable the list's scroll bar while an itemRenderer has focus.
      Is there anyway to disable a scroll bar without hiding it?

      Thanks in advance for any insight.

      Below is a simplified version of my code that demonstrates this issue
      Sometimes the list jumps to the end when you type in one of the text fields near the beginning.
      Sometime it jumps to beginning when you are editing a field near the end.
        • 1. Re: List Scrolls when it shouldn't.
          Kerplunk_667 Level 1
          I figured out what is causing issue, but I am not able to fix it.
          When I type the 1st letter of another textArea it autoScrolls to that textArea. How can I prevent this from happening?
          • 2. Re: List Scrolls when it shouldn't.
            m_hartnett Level 3
            add editable="true" to your List object
            • 3. List Scrolls when it shouldn't.
              Kerplunk_667 Level 1
              Ah okay. Thanks much for your help. This has put me on the right track but has created another set of issues. Perhaps you can point me in the right direction.
              My data provider is actually an XMLList
              and my ItemRenderer is a custom MXML component with a label that should NOT be editable and a textArea which should be.

              When you click on the text area it not only displays the raw XML (as opposed to the data.text() that is bound to the textArea) it also automatically alters the XML. In fact if you just click back on forth on two item renderers without ever editing anything, it adds xml nodes and other garbage
              My original node looked like this
              <entry time="Wed Nov 5 15:00:23 GMT-0600 2008">b</entry>

              (which should display just "b" in the textArea)

              After clicking the item renderer it looks like this

              <entry time="Wed Nov 5 15:00:23 GMT-0600 2008">
              b
              <label>&lt;entry time="Wed Nov 5 15:00:23 GMT-0600 2008"&gt;
              b
              &lt;label&gt;&amp;lt;entry time="Wed Nov 5 15:00:23 GMT-0600 2008"&amp;gt;
              b
              &amp;lt;label&amp;gt;b&amp;lt;/label&amp;gt;
              &amp;lt;/entry&amp;gt;&lt;/label&gt;
              &lt;/entry&gt;</label>
              </entry>

              I wish I could just disable the auto scroll feature as I am already handling the updating of my dataProvider in a custom fashion (to allow undos)

              • 4. Re: List Scrolls when it shouldn't.
                Kerplunk_667 Level 1
                I found a solution to my initial problem. Disabling key navigation in a list... wish I had found this link 72 hrs ago!

                http://blog.flexexamples.com/2008/06/11/disabling-keyboard-navigation-on-the-list-control- in-flex/