 
         textDisplay.scrollToRange(anchorPosition, activePosition);
     }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Called when the RichEditableText dispatches a 'styleChanged' event.
+     */
+    private function textDisplay_styleChangedHandler(event:Event):void
+    {
+        if (!scroller)
+            return;
+            
+        // If there is a scroller and line breaks are "toFit" turn off the 
+        // horizontal scroll bar so the scroller will give us a consistent 
+        // width and the text will wrap in the same place.           
+        if (textDisplay.getStyle("lineBreak") == "toFit")
+        {
+            if (scroller.getStyle("horizontalScrollPolicy") != "off")
+                scroller.setStyle("horizontalScrollPolicy", "off");
+        }
+        else
+        {
+            // This could potentially wipe out a user specified setting.
+            // Workaround it by settting Scroller's horizontalScrollPolicy
+            // after every RET style change.
+            if (scroller.getStyle("horizontalScrollPolicy") == "off")
+                scroller.setStyle("horizontalScrollPolicy", "auto");
+        }
+    }
 }
 
 }

        if (instance == textDisplay)
        {
            // In default.css, the TextArea selector has a declaration
            // for lineBreak which sets it to "toFit".  It needs to be on
            // TextArea rather than RichEditableText so that if changed later it
            // will be inherited.

            // The skin is loaded after the intial properties have been
            // set so these wipe out explicit sets.
            textDisplay.multiline = true;
        }
        
        // The scroller, between textDisplay and this in the chain, should not 

                scroller.horizontalScrollBar.snapInterval = 0;
            if (scroller.verticalScrollBar)
                scroller.verticalScrollBar.snapInterval = 0;
        }
    }

    /**
     *  @private
     */
    override protected function partRemoved(partName:String, 
                                            instance:Object):void
    {                
        super.partRemoved(partName, instance);
                
        if (instance == textDisplay)
        {
            textDisplay.removeEventListener("styleChanged", 
                                            textDisplay_styleChangedHandler);
        }
    }    
    //--------------------------------------------------------------------------
    //
    //  Methods
