dhtmlxCombo; options offset miscalculation

It appears that the options list when displayed is failing to take in to account a border width on body when calculating the left/top offsets.

Once I figured it out I removed the border width from body and made a div do the needed border, however I’m hoping this gets fixed and help anyone else with a similar problem.

Locally the issue isn’t reproduced. Could you provide a sample ?

<style>body { border:10px solid #fff; }</style><select id="combobox"><option value="1">One</option></select>
<script>var cb = dhtmlXComboFromSelect('combobox');</script>

Click the select and the options will be offset from the select, misaligned the exact amount of the body.border width.

Locally the list opens in a correct position - the sample is attached.

I’ve tested the latest development version. Possibly there reason for the problem is in combo version. So, try to use libraries from attachment
sample.zip (19.6 KB)

It’s still happening with the sources from your attachment, I can reproduce the wrong offsets in Firefox (2.6.3 win), Safari (4.0.5 win), IE8 (only when not in compatibility mode).

Google Chrome works as expected.

Here is a better example …


One Two [/code]

We’ve reproduced the issue. But unfortunately there isn’t universal solution that allows to consider the border width of body. But you may try to add correction manually.
Combo uses getPosition method to calculate the list position. And you may correct top and left list position as you need:

var cb = dhtmlXComboFromSelect(‘combobox’);

var getPos = cb.getPosition;

cb.getPosition = function(){
var pos = getPos.apply(this,arguments);
var left = pos[0]+ your_correction;
var top = pos[1]+ your_correction;
return [left,top];