CheckComboBox ListChangeListener fires off twice after selection change
See original GitHub issueOriginal report by FanFeeds (Bitbucket: user3822, GitHub: Unknown).
I’m using a custom ControlsFX that has Pull Request #677 which adds the ability to click on the label next to the checkbox in order to select the item.
After some testing, I believe it comes down to the changes made in this pull request, and I’ll explain why.
Here’s what my test code looks like:
#!java
checkComboBox.getCheckModel().getCheckedItems().addListener(new ListChangeListener<String>() {
@Override
public void onChanged(ListChangeListener.Change<? extends String> c) {
while (c.next()){
System.out.println("test");
}
}
});
After a few hours of testing, I found out that if I click directly on the checkbox, it only fires off once. But if I click on the label to the right of the checkbox, it fires off twice.
I also created a separate project with the publicly available ControlsFX and tried it out. It works properly (which, considering my previous testing, it should work properly because the label on the right cannot be clicked in order to select the checkbox).
Put it all together, and I think the culprit lies somewhere in the changes made in Pull Request #677.
Happy Holidays and take care, everyone!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
This is still a bug in v11.0.3. I am unable to find the referenced PR’s associated with this issue.
thanks to @JonathanGiles for investigating the problem and raising this ticket, I’m seeing this behaviour too in
11.1.1
.