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

[ui5-combobox] Change event is not fired as documented on ui5-combobox #5432

Closed
1 of 4 tasks
ixiler opened this issue Jun 29, 2022 · 6 comments · Fixed by #5447
Closed
1 of 4 tasks

[ui5-combobox] Change event is not fired as documented on ui5-combobox #5432

ixiler opened this issue Jun 29, 2022 · 6 comments · Fixed by #5447
Assignees
Labels
Autopilot bug This issue is a bug in the code documentation This issue is about wrong documentation High Prio TOPIC RL

Comments

@ixiler
Copy link

ixiler commented Jun 29, 2022

Bug Description

All the descriptions bellow are about ui5-combobox component
The change event doesn't fire when the value in the input matches a ui5-cb-item text attribute exactly. In such case the event is not fired when the ui5-cb-item is clicked, when the Enter button is pressed and when the input is focused out.

Expected Behavior

The change event to fire as per the documentation description "Fired when the input operation has finished by pressing Enter, focusout or an item is selected.".
A temporary workaround would be appreciated as well, since using selection-change events fires before the user interaction is finished (pressing enter, clicking on a ui5-cb-item or focusing out). The Enter press and focus out already have workarounds on our end, but couldn't catch the ui5-cb-item event.

Steps to Reproduce

  1. Go to the sandbox
  2. Enter Item1 into the combo box
  3. Press Enter
  4. Observe that the event is not fired, the Selected value is not updated in the designated span and no log is present in the console.
  5. The Item1 value should still be present in the input. Open the dropdown.
  6. Click on Item1
  7. Observe that the event is not fired, the Selected value is not updated in the designated span and no log is present in the console.
  8. Focus the input
  9. Focus out the input
  10. Observe that the event is not fired, the Selected value is not updated in the designated span and no log is present in the console.

Isolated Example

The sandbox provided is a simple one: There is a single combobox with 3 items and a span above it that is changed by the events fired by the change event. Also the subscription to the change event logs the received value to the console.
sandbox

Context

  • UI5 Web Components version: {1.4.0}
  • OS/Platform: {any}
  • Browser: {any}
  • Affected component: {ui5-combobox}

Log Output / Stack Trace / Screenshots

Priority

  • Low
  • Medium
  • High
  • Very High

The priority indicates the severity of the issue. To set the appropriate priority consider the following criteria:

  • Breaks entire application or system - High or Very High
  • Accessibility issue - Medium or High
  • Functional issue - Medium or High
  • Visual issue - Low or Medium

Note: The priority might be re-evaluated by the issue processor.

Stakeholder Info (if applicable)

  • Organization: {SAP}
  • Unit: {Automation Pilot}
  • Business impact: {Customers already complain that the data they enter is not updated on form submit}
@nnaydenow nnaydenow self-assigned this Jun 29, 2022
@ilhan007
Copy link
Member

Hi @SAP/ui5-webcomponents-topic-rl @nikolay-kolarov any workaround available while we tackle the issue would be appreciated.

@nnaydenow
Copy link
Contributor

Hi @SAP/ui5-webcomponents-topic-rl,

Issue is reproducible and you can reproduce it as author describes it. It is reproducible only if the input's text match whole item text.

Regards,
Nayden

@nnaydenow nnaydenow added bug This issue is a bug in the code TOPIC RL High Prio labels Jun 29, 2022
@d3xter666 d3xter666 self-assigned this Jun 30, 2022
@d3xter666
Copy link
Contributor

Hi @ixiler ,

You'd need to use the ui5-change event. The change event comes from the browser and is a native event. We're not touching those events. But for the sake of business correctness, we have introduced the ui5-* custom events.
As selection in the Combobox is quite specific, the correct behavior comes with ui5-change.

Cheers

@d3xter666 d3xter666 added consulting documentation This issue is about wrong documentation and removed bug This issue is a bug in the code labels Jun 30, 2022
@ixiler
Copy link
Author

ixiler commented Jun 30, 2022

Hi @d3xter666,

For what version of the web components is that true? I tried to modify the sandbox with the proposed event and it does not work as expected - the bug is still reproducible. Can you provide a working example?

Also is that a general rule that all documented events are expected to have ui5- prepended to them in order to work as documented?

Cheers

@pskelin
Copy link
Contributor

pskelin commented Jun 30, 2022

the ui5- event prefix is only useful when the original event is somehow colliding with a 3rd party library or becomes a standard browser event in the future. In such cases, the firing of the documented event can be disabled via the noConflict configuration as described here:
https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/01-configuration.md#noconflict

Other than that, the original event name as documented should be used and should have the same behaviour as the prefixed one.

@d3xter666 please double check if this is the intended behaviour of the event.

@d3xter666 d3xter666 reopened this Jul 1, 2022
@d3xter666
Copy link
Contributor

Thanks! Would recheck it

@d3xter666 d3xter666 added bug This issue is a bug in the code and removed consulting labels Jul 1, 2022
ilhan007 added a commit that referenced this issue Oct 3, 2022
* chore: release v1.4.0

* chore: translation delivery (#5278)

* chore: release v1.5.0

* chore: update css-vars-usage

* fix(ui5-combobox): correctly fire change event on item press (#5447)

Fixes #5432

* chore: release v1.6.0

* chore: update yarn lock

* chore: release v1.7.0

* chore: update playground

* fix(ui5-tabcontainer): fixed error when no tabs (#5793)

* fix(ui5-tabcontainer): fixed error when no tabs

* chore: release v1.7.1

* chore: release v1.8.0

Co-authored-by: SAP LX Lab Service Account <tmsatsls+github.com_service-tip-git@sap.com>
Co-authored-by: Yavor Ivanov <d3xter666@users.noreply.github.com>
Co-authored-by: TeodorTaushanov <teodor.taushanov@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Autopilot bug This issue is a bug in the code documentation This issue is about wrong documentation High Prio TOPIC RL
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

5 participants