Opened 14 years ago

Closed 14 years ago

#566 closed defect (fixed)

Does not honor 'cols' or 'rows' on textarea in MSIE

Reported by: snowhare@… Owned by: gogo
Priority: high Milestone:
Component: Xinha Core Version:
Severity: major Keywords: MSIE rows cols
Cc:

Description (last modified by gogo)

The window is forced to the minimum possible height and width regardless of the 'rows=' or 'cols=' attributes when using MSIE. This renders the editor unusable with them. The problem is lines 98/99 of htmlarea.js specifiy the initial dimensions incorrectly.

The following patch fixes it:

--- htmlarea.js 2005-10-22 04:38:43.000000000 -0700
+++ new-htmlarea.js     2005-10-22 04:36:31.000000000 -0700
@@ -95,8 +95,8 @@
     // Before we modify anything, get the initial textarea size
     this._initial_ta_size =
     {
-      w: textarea.style.width ? textarea.style.width   : (textarea.offsetWidth + 'px'),
-      h: textarea.style.height ? textarea.style.height : (textarea.offsetHeight + 'px')
+      w: textarea.style.width ? textarea.style.width   : ((textarea.offsetWidth) ? (textarea.offsetWidth + 'px') : textarea.cols + 'em'),
+      h: textarea.style.height ? textarea.style.height : ((textarea.offsetHeight) ? (textarea.offsetHeight + 'px') : textarea.rows + 'em')
     };

     this._editMode = "wysiwyg";

Attachments (1)

htmlarea-msie-textarea-cols-rows.patch (727 bytes) - added by snowhare@… 14 years ago.
Patch to fix rows/cols bug with MSIE

Download all attachments as: .zip

Change History (3)

Changed 14 years ago by snowhare@…

Patch to fix rows/cols bug with MSIE

comment:1 Changed 14 years ago by gogo

  • Description modified (diff)

comment:2 Changed 14 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed

Hmmm, curious. I don't see anything harmful in the patch, it's not going to break anything because it only happens when offsetWidth/Height is 0/false/undefined anyway, what's curious is that they should be 0/false/undefined.

Oh well, I guess IE just sucks.

Applied in changeset:398

Note: See TracTickets for help on using tickets.