IntegerField Step Buttons not triggering FocusListener

Is this a bug, a feature, or am I just doing it wrong?

TextField textFilter = new TextField();
Checkbox inactiveCheckbox = new Checkbox();
IntegerField playersFilter = new IntegerField();
  :
playersFilter.addFocusListener(e -> {
    // this is not triggered clicking minus or plus 
        textFilter.clear();
    inactiveCheckbox.clear();
});
playersFilter.addValueChangeListener(e -> {
    updateList();
});

The “or” in the TextField should be cleared, but it never enters the lambda expression. It works right when I click into the typing area, but it would be preferred if it also gets triggered when I click the plus or minus buttons on either end of the number input area.
image.png

the -/+ are not really part of the field and therefore not called with the focus listener. Use the value change listener if you wanna be notified once the value of the field changes (by typing or clicking)

Thanks! I am now, but it triggers two grid updates(from updateList()) instead of just one, which I’m not happy about (due to multiple clearings which triggers value changes). Still would be nice if the buttons had their own FocusListener or just triggered it along with the IntegerField. Either way would be better than none, IMHO.

Just an idea for a hack: the value change listener contains the old and new value - you could compare them, if they are different by -1/+1 it’s highly possible the user clicked one of the buttons :sweat_smile:

Hmmm… I’ll have to check that out. Could be really good.