Opened 11 years ago

Closed 10 years ago

#9092 closed defect (fixed)

Editor lineHeight not set correctly in IE

Reported by: rmaccracken Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.4
Component: Editor Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:

Description

In RichText.js, you will find the following code:

var lineHeight = _cs.lineHeight;
if(lineHeight.indexOf("px") >= 0){
    lineHeight = parseFloat(lineHeight)/parseFloat(_cs.fontSize);
}else if(lineHeight.indexOf("em")>=0){
    lineHeight = parseFloat(lineHeight);
}else {
    lineHeight = "1.0";
}

The last line (setting lineHeight to "1.0") seems to cause a problem with IE7 and IE8 (and maybe others) as it does not show up as a CSS rule (using new IE8 developer tools). This then causes a problem with the bottom of text being chopped off for letters like 'j' and 'g'.

To fix the problem all I did was add a condition to the last else clause:

} else if (!lineHeight) {

I don't know if that is the absolutely correct fix, but it worked for me. In IE8, the lineHeight variable is initially equal to "normal", so leaving it alone seems to solve the problem.

You can see this problem using the attached file or at the Dojo Campus docs: http://docs.dojocampus.org/dijit/Editor.

Attachments (1)

bug.html (759 bytes) - added by rmaccracken 11 years ago.
Test case

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by rmaccracken

Attachment: bug.html added

Test case

comment:1 Changed 10 years ago by bill

Milestone: tbdfuture
Owner: liucougar deleted

comment:2 Changed 10 years ago by Jared Jurkiewicz

Milestone: future1.4
Owner: set to Jared Jurkiewicz

comment:3 Changed 10 years ago by Jared Jurkiewicz

I think the default should be 'normal', not 1.0.

comment:4 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [20447]) Fixing line-height def to default to normal instead of 1.0. Fixes an IE issue with truncation of letter 'tails'. \!strict fixes #9092

Note: See TracTickets for help on using tickets.