0 Replies Latest reply on Jan 16, 2008 5:58 AM by markdemich

    Autosizing Height in custom component

    markdemich Level 1
      I'm recreating a component that kind of like a text area control. I want it's height to autosize based on it's width which is set by it's parent. For instance, say I include it in a resizable window with 100% width, but I want it's height to adjust based on how it wraps it's contents. The way I'm doing it now is to set it's height inside it's "updateDisplayList" basically, I ignore the unscaledHeight passed in and at the end of my updating, I set this.height to what I want. Unfortunately, this causes a second pass to updateDisplayList, which I don't like because my updateDisplayList is expensive.

      Is there a built-in component that works this way so I can look at the source as a guide. From what I can tell, the TextArea control does not autosize it's height.