Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on-change callback not working on version 4.2.6. #792

Closed
sohrabtaee opened this issue Mar 18, 2019 · 4 comments
Closed

on-change callback not working on version 4.2.6. #792

sohrabtaee opened this issue Mar 18, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@sohrabtaee
Copy link
Contributor

sohrabtaee commented Mar 18, 2019

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();
}
@tomivirkki tomivirkki added the needs triage Has to be triaged by the team label Mar 18, 2019
@Haprog Haprog added the bug Something isn't working label Mar 19, 2019
@Haprog Haprog self-assigned this Mar 21, 2019
@Haprog Haprog added in progress and removed needs triage Has to be triaged by the team labels Mar 21, 2019
@Haprog
Copy link
Contributor

Haprog commented Mar 21, 2019

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.

@Haprog
Copy link
Contributor

Haprog commented Mar 21, 2019

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

Haprog added a commit that referenced this issue Mar 21, 2019
Adds a test for verifying if the regression described in #792 is fixed or not.
This test is currently failing, but would pass if this change would be reverted https://github.com/vaadin/vaadin-combo-box/pull/785/files#diff-b73223a74b9a1b791eaba97e72452eb5 though reverting that would break 2 lazy loading tests.
Haprog added a commit that referenced this issue Mar 21, 2019
Adds a test for verifying if the regression described in #792 is fixed or not.
This test is currently failing, but would pass if this change would be reverted https://github.com/vaadin/vaadin-combo-box/pull/785/files#diff-b73223a74b9a1b791eaba97e72452eb5 though reverting that would break 2 lazy loading tests.
Haprog added a commit that referenced this issue Mar 22, 2019
Adds a test for verifying if the regression described in #792 is fixed or not.
This test is currently failing, but would pass if this change would be reverted https://github.com/vaadin/vaadin-combo-box/pull/785/files#diff-b73223a74b9a1b791eaba97e72452eb5 though reverting that would break 2 lazy loading tests.
@Haprog Haprog removed the in review label Mar 22, 2019
@Haprog
Copy link
Contributor

Haprog commented Mar 22, 2019

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.

@Haprog
Copy link
Contributor

Haprog commented Mar 22, 2019

The fix is now in v4.2.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants