SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.51k stars 262 forks source link

[ComboBox]: Change event fired at incorrect time in version 1 #9776

Closed lormanlau1 closed 3 weeks ago

lormanlau1 commented 3 weeks ago

Bug Description

Combobox when selecting the element using arrow keys fires change event in version 1.24.9 Issue was fixed sometime in version 2 but we need this to be patched into version 1

Affected Component

ui5-combobox

Expected Behaviour

Change event is only fired when list item is clicked, when enter is pressed, or when focus is lost

Isolated Example

1.24.9 playground

Steps to Reproduce

  1. Click on the link to the SAP UI5 Web Component playground.
  2. Open the developer console.
  3. Use arrow keys to navigate through the combobox
  4. Observe that all event are fired.
  5. version 2.1.2 is working fine

Log Output, Stack Trace or Screenshots

No response

Priority

None

UI5 Web Components Version

1.24.9

Browser

Chrome

Operating System

MacOS Sonoma 14.6.1

Additional Context

No response

Organization

SAP SuccessFactors

Declaration

elenastoyanovaa commented 3 weeks ago

Hello @lormanlau1 ,

While I agree that the desired behavior is the more correct one, we could not change this in version 1.x because this is considered a breaking change. This is a change in the behavior and according to the documentation of the change event: "Fired when the input operation has finished by pressing Enter, focusout or an item is selected." it is not clearly a bug, but a misinterpretation of the event. There was a raised issue for the same before: https://github.com/SAP/ui5-webcomponents/issues/5659

and after analysis and discussions with the team and designers we updated it for version 2.0: https://github.com/SAP/ui5-webcomponents/pull/8711

but this change cannot be downported to 1.x as it is a Breaking Change.

Kind Regards, Elena