Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 293574

Summary: [Cocoa] Selected item is not highlighted in the Combo drop-down list
Product: [Eclipse Project] Platform Reporter: Lakshmi P Shanmugam <lshanmug>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: cocoakevin, eclipse.felipe, lshanmug, markus.kell.r
Version: 3.6Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug

Description Lakshmi P Shanmugam CLA 2009-10-28 10:14:48 EDT
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.14) Gecko/2009082706 Firefox/3.0.14
Build Identifier: I20091027-0100

Selected item is not highlighted in the Combo drop-down list in Cocoa. 
The item gets highlighted in the 3.6M2 build.

Reproducible: Always

Steps to Reproduce:
1. Run Snippet24.
2. Select an item in the drop-down list.
3. Click on the drop-down arrow, the selected item is not highlighted in the list.
Read-only Combo works fine.
Comment 1 Kevin Barnes CLA 2009-10-30 15:03:19 EDT
We get in the way of the normal selection and text setting in Combo in order to get Verify and Modify events working (see setObjectValue where we hammer in our own value). We are probably breaking the selection somehow.
Comment 2 Lakshmi P Shanmugam CLA 2009-11-09 09:25:23 EST
Hi Kevin,
I verified that using NSAttributedString in place of NSString as the Combo objects causes this. Selection of the item is happening correctly, i.e, the indexOfSelectedItem() is returning the correct value but the background highlight color for the selected item is not being shown. I think it is because the item is a NSAttributedString and not NSString. 
I'm not sure how to fix this. I tried to set/unset the background color attribute for the NSAttributedString on selection. Please suggest how I should go about fixing this bug.

I noticed another difference, when using NSAttributedString, long strings in the pop-up list are being truncated. When using NSString, text used to be truncated and ellipsis added at the end. We have to set the lineBreakMode to NSLineBreakByTruncatingTail to get the same behavior.
Comment 3 Kevin Barnes CLA 2009-11-09 10:02:42 EST
thanks Lakshmi. I'm not sure how to fix this, but in any case, it's probably not too urgent.
Felipe - see Lakshmi's comments. Looks like there are some problems with using NSAttributedString in NSComboBox.
Comment 4 Markus Keller CLA 2011-05-20 05:17:32 EDT
The right item quickly blinks in the drop down list. Also happens when you try to change the item with the keyboard via Arrow_Down.
Comment 5 Lakshmi P Shanmugam CLA 2017-12-20 07:13:16 EST
Reassigning to inbox.
Comment 6 Eclipse Genie CLA 2020-12-11 14:04:50 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.