This is a migrated thread and some comments may be shown as answers.

Long items show their endings under IE8

4 Answers 60 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Tomasz M.Lipiński
Top achievements
Rank 1
Tomasz M.Lipiński asked on 19 Jan 2010, 11:09 AM
Hi,
There is a RadComboBox that has items longer than the width of the combo. After selecting such an item, the beginning of this item should be displayed in the combo. And it is so under most of browsers: FF, Opera, Chrome, Safari and IE7. But under IE8 the ending of the selected item is displayed. I can manually shift it to the beginning (using "Home" key) but it is not a solution, of course.
Is there any way to make IE8 behaving in the same way as other browsers?
I'm using Q3 2009 version of RadControls. Normally I use the "Simple" skin but it behaves in the same way when using the "Default" skin - so it seems that it is not an skin issue.

Regards
Tomasz

4 Answers, 1 is accepted

Sort by
0
Accepted
Kamen Bundev
Telerik team
answered on 22 Jan 2010, 12:44 PM
Hi Tomasz,

Yes, IE8 has this annoying "feature". However, you can attach a OnClientDropDownClosing handler to move the input caret to the beginning of RadComboBox and avoid that:
function dropDownClosing (sender, args) {
    var inputElement = sender.get_inputDomElement();
    
    if (inputElement.setSelectionRange)
        inputElement.setSelectionRange(0, 0);
    else {
        var textRange = inputElement.createTextRange();
        textRange.moveEnd('sentence', -100000); // A bug in IE prevents selecting proper range.
        textRange.moveStart("character", 0);
        textRange.moveEnd("character", 0);
        textRange.select();
    }
}

If you intend to use keyboard navigation you will need another handler to avoid the same scrolling effect:
function keyPressing(sender, args) {
    var event = args.get_domEvent();
    
    if (event.type == 'keydown' && (event.keyCode == 38 || event.keyCode == 40))
        setTimeout( function () { dropDownClosing(sender, args) }, 0 );
}


Regards,
Kamen Bundev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tomasz M.Lipiński
Top achievements
Rank 1
answered on 22 Jan 2010, 12:58 PM
Hi,
Thanks. Works great.
Best regards
Tomasz
0
Jeanne Kornkven
Top achievements
Rank 1
answered on 04 Mar 2010, 11:29 PM
We were having a similar issue in IE7.  The long items showed the end of the text for approximately 5 seconds, then shifted to the right.  This fix resolved that issue, and the text is properly aligned right away.
0
James Van Buren
Top achievements
Rank 2
answered on 24 Mar 2010, 04:34 PM
will this be fixed in next release or perhaps SP?
We had similar issue, but we really fixed by trimming text as it was padded by characters before due to CHAR vs VARCHAR db storage.
Tags
ComboBox
Asked by
Tomasz M.Lipiński
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Tomasz M.Lipiński
Top achievements
Rank 1
Jeanne Kornkven
Top achievements
Rank 1
James Van Buren
Top achievements
Rank 2
Share this question
or