RFR: 8333275: ComboBox: adding an item from editor changes editor text [v2]

Michael Strauß mstrauss at openjdk.org
Fri Jan 31 19:18:17 UTC 2025


On Fri, 31 Jan 2025 17:27:47 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   update copyright header
>
> modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java line 1315:
> 
>> 1313:                             && (addedItemOffset = c.getAddedSubList().indexOf(selectedItem)) >= 0
>> 1314:                             && selectedIndex == c.getFrom() + addedItemOffset) {
>> 1315:                         doSelectionUpdate = false;
> 
> which scenario does this code path handle outside of tests?
> 
> I could never hit a breakpoint in line 1315, except in ensureEditorValueDoesNotChangeWhenCurrentEditorValueIsAddedToItemsList().

It's only when `ComboBox.getEditor().setText(...)` is called, which doesn't seem to immediately update the current value. This shouldn't really happen in most applications.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1692#discussion_r1937796779


More information about the openjfx-dev mailing list