question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ComboBox doesn't update immediately after set value via useState

See original GitHub issue

Describe the bug The value of ComboBox doesn’t update immediately after set value via useState.

To reproduce Steps to reproduce the behavior:

  1. Go to https://sap.github.io/ui5-webcomponents-react/?path=/story/ui5-web-components-combobox--generated-default-story
  2. Click the down arrow to select one item from the dropdown list.
  3. Typing some text like ‘test’ in the value property on the right panel, you will see the ComboBox still shows the previous value text.
  4. Just click on the ComboBox, you will see the text updated.

Expected behavior The text value should be updated immediately once changing it.

Context

  • UI5 Web Components version: v0.10.5

Affected components (if known) ComboBox

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
MarcusNotheiscommented, Sep 23, 2020

Hey @fifoosid,

looks like ComboBox is not reacting to the value update immediately. I’ve created this codesandbox with “plain” UI5 Web Components and I can observe the same behavior.

Web Components Version: 1.0.0-rc.8

0reactions
MapTo0commented, Mar 10, 2021

I am taking over that one. We included it in the current backlog and I will update you for any progress made in a few days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component not updating even though useState value has ...
1. I don't follow, if userName has updated in the useEffect when you log it, it's the same value used in the render...
Read more >
React setState does not immediately update the state - Medium
Returns a stateful value, and a function to update it. The function to update the state can be called with a new value...
Read more >
How To Bind State with Select Option (Combo Box) on REACT ...
How To Bind State with Select Option ( Combo Box ) on REACT.Hey guys!! if you learn something new or my video helps...
Read more >
How To Call Web APIs with the useEffect Hook in React
After creating the state handlers, set the value of the input to itemInput and update the value by passing the event.target.value to the ......
Read more >
[Resolved] useState not showing updated value - Freaky Jolly
Sometimes when updating the state in a functional or class component in React, does not reflect the updated values immediately.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found