Vaadin-combo-box: on-change callback not working on version 4.2.6.

Created on 18 Mar 2019  ·  4Comments  ·  Source: vaadin/vaadin-combo-box

Description

I have a combo box with an on-change event handler. The event handler only gets called when I clear the selection, not changing the selection. It happens in version 4.2.6 when using in Polymer 2.

<vaadin-combo-box
  theme="small"
  hidden="[[_hideEnvironmentSwitch]]"
  label="Change Environment"
  on-change="_changeEnvironment"
  items="[[_environments]]"
  value="{{_selectedEnvironment}}">
</vaadin-combo-box>
_changeEnvironment() {
  debugger
  if (this._selectedEnvironment) {
    // some logic
  }
  this._toggleEnvironmentSelector();
}
bug

Most helpful comment

This fix is now in master and will be part of the next patch release (presumably v4.2.7) which will probably be released today.

All 4 comments

This can be reproduced in https://cdn.vaadin.com/vaadin-combo-box/4.2.6/demo/#combo-box-basic-demos by setting a change listener on any of the combo boxes. E.g. select one in inspector and run $0.addEventListener('change', console.log); then try changing the value.

Actually this only seems to be a problem in the case when you select an item by clicking on the items in the dropdown. The change event is still triggered normally if you select an item via keyboard navigation or by typing in an exact match and then unfocusing or hitting Enter.

Can confirm this is a regression in v4.2.6.

If you try the same in https://cdn.vaadin.com/vaadin-combo-box/4.2.5/demo/#combo-box-basic-demos then the event is triggered normally also when you select the item by clicking on it.

This regression was introduced by #785. It works fine on the previous commit before that.

This fix is now in master and will be part of the next patch release (presumably v4.2.7) which will probably be released today.

The fix is now in v4.2.7.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JMuratha picture JMuratha  ·  4Comments

mas4ivv picture mas4ivv  ·  16Comments

heruan picture heruan  ·  14Comments

osamamaruf picture osamamaruf  ·  4Comments

web-padawan picture web-padawan  ·  5Comments