PDA

View Full Version : Wrong tooltip title height



gaellafond
26 Jun 2011, 8:58 PM
Hello,

I found a bug in the calculation of the height of tooltip's title.

When the title is larger than the html content, it assign a larger height, even if there is enough space to display the title in one line. The bug seems to be related with minWidth.



/*
- Using width -
Display (as expected):
---------------------
| 12 34 56 12 34 56 |
| 1 |
---------------------
*/
Ext.create('Ext.tip.ToolTip', {
title: '12 34 56 12 34 56',
html: '1',
minWidth: 200,
width: 200,
enabled: true
}



/*
- Only minWidth -
Display (very large title):
---------------------
| 12 34 56 12 34 56 |
| |
| |
| |
| |
| |
| 1 |
---------------------
*/
Ext.create('Ext.tip.ToolTip', {
title: '12 34 56 12 34 56',
html: '1',
minWidth: 200,
enabled: true
}



/*
- Larger html content -
Display (as expected):
---------------------
| 12 34 56 12 34 56 |
| 123456 123456 |
---------------------
*/
Ext.create('Ext.tip.ToolTip', {
title: '12 34 56 12 34 56',
html: '123456 123456',
minWidth: 200,
enabled: true
}



/*
- no width, no minWidth -
Display (double height title):
---------
| 12 34 |
| 56 12 |
| 34 56 |
| |
| |
| |
| 1 |
---------
*/
Ext.create('Ext.tip.ToolTip', {
title: '12 34 56 12 34 56',
html: '1',
enabled: true
}
The bug also occur for the other way around. When the content is large enough, the title do not wrap even if it's suppose to, and some content is lost:


/*
- html content proportional to the title -
Display (as expected):
---------------------------------------------------------
| 12 34 56 12 34 56 12 34 56 12 34 56 12 34 56 12 34 OK |
| LOST!! |
| 123456 123456 123456 123456 123456 123456 123456 |
| 123456 |
---------------------------------------------------------
*/
Ext.create('Ext.tip.ToolTip', {
title: '12 34 56 12 34 56 12 34 56 12 34 56 12 34 56 12 34 OK LOST!!',
html: '123456 123456 123456 123456 123456 123456 123456 123456',
enabled: true
}



/*
- Very large content, same title -
Display (title is truncated):
---------------------------------------------------------
| 12 34 56 12 34 56 12 34 56 12 34 56 12 34 56 12 34 OK |
| 123456 123456 123456 123456 123456 123456 123456 |
| 123456 123456 123456 123456 123456 123456 123456 |
| 123456 123456 |
---------------------------------------------------------
*/
Ext.create('Ext.tip.ToolTip', {
title: '12 34 56 12 34 56 12 34 56 12 34 56 12 34 56 12 34 OK LOST!!',
html: '123456 123456 123456 123456 123456 123456 123456 123456 123456 123456 123456 123456 123456 123456 123456 123456',
enabled: true
}