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

[ObjectPage]: Setting state in onSelectedSectionChange prevents Section change #6600

Closed
1 task done
wvudako opened this issue Nov 6, 2024 · 1 comment · Fixed by #6663
Closed
1 task done

[ObjectPage]: Setting state in onSelectedSectionChange prevents Section change #6600

wvudako opened this issue Nov 6, 2024 · 1 comment · Fixed by #6663
Labels

Comments

@wvudako
Copy link

wvudako commented Nov 6, 2024

Describe the bug

An ObjectPage with multiple Sections
In ObjectPage#onSelectedSectionChange a state is set
Switching sections is not possible anymore as it always jumps back to the previously selected section

Problem introduced in webcomponents-react 2.3 and persistent in 2.4
webcomponents 2.3/2.4

Clicking on the second section "a lot" makes it work at some point

Workaround: Delaying the setState fixes the problem
setTimeout(() => setState(!state), 200);

Note: In our case we need to know which section is selected, is there an alternative way to do that than persist it in a state whenever it changes? That would not resolve the bug obviously but would fix our current problem

Isolated Example

https://stackblitz.com/edit/github-j7zrdv

Reproduction steps

  1. ObjectPage with onSelectedSectionChange that sets a React state and 2 sections
  2. Click second Section
  3. Content jumps back to first section

Expected Behaviour

Second section is selected

Screenshots or Videos

No response

UI5 Web Components for React Version

2.4

UI5 Web Components Version

2.4

Browser

Chrome

Operating System

Windows 11

Additional Context

No response

Relevant log output

No response

Organization

No response

Declaration

  • I’m not disclosing any internal or sensitive information.
@ui5-webcomponents-react-bot
Copy link
Contributor

🎉 This issue has been resolved in version v2.5.0 🎉

The release is available on v2.5.0

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

2 participants