-
Notifications
You must be signed in to change notification settings - Fork 104
[ObjectPage]: Renders all sections regardless which one is active #5600
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
Comments
Hi colleagues, In this issue, the affected component is the ObjectPage and there is similar issue for the FCL, that I did not transfer, but probably the root cause would be the same. My first thought is an application problem, but could take a look? |
I wasn't able to reproduce the issue with the given StackBlitz example. The ObjectPage still only renders the current selected section in 2024-03-13_14-06-43.mp4 |
Hi, maybe we should have made it more descriptive. If you stay on 'section 1' the text should say 'Am a really section one?' but, instead the text comes from the 'section 2' useEffect, which changes the text to 'Am I really section two?' after 3 seconds... which means section 2 gets rendered too. |
Thanks for the clarification :) The linked PR will fix this issue. However, I would recommend not relying on side-effects too much, since this can lead to undesired behavior like in this case. E.g. just because a component has no representation in the DOM or its DOM elements aren't visible, doesn't mean that it's not mounted and therefore registered in the React fiber tree. Using states and props to control behavior inside a React App is always preferable. You can find out more about it here: https://react.dev/learn/you-might-not-need-an-effect |
Thank you @Lukas742 What matters here is that 1.21.2 was definitely not considering columns which should not be part of the layout (the other case is similar) ...but from 1.22.0 they are , Thanks God we have some tests in place and I'm surprised there are no tests preventing those changes to reach Have fun 👋 |
Hi @signavio-fghedina, @TinaAngeloski I forgot to mention that the error shown in the screenshot was still not reproducible for me with the given stackblitz example. So the linked PR will only fix mounting all
This doesn't seem to be related to the |
Chiming in for a quick second as I'm also experiencing the same issue. I'm still attempting to isolate the issue, so I unfournately don't have a reproducible example to share yet. But I do believe it has to do with the You can see in the attached video of our demo data that when the The line
NoObjectPage.movWithObjectPage.mov |
When you have complex applications its challenging to reproduce the same behaviour on a simple sandbox. |
Thanks @qscheitlin I tried a few things using your description and videos as guide, but unfortunately still wasn't able to reproduce the error. At first I thought it might be related to the unmount order of components, but the observer seems to be never be called before unmounting the component where the Since this is most probably related to the container element of the TabContainer not being defined at the time the @TinaAngeloski I know it's hard to isolate bugs inside complex structures, but how can we ensure to fix an issue if we don't know its root cause? Structuring bug reports to provide as much information as possible is essential, especially when no reproducible example is given. As mentioned above, a fix is hopefully simple here, but this might not be the case for other issues. Sometimes, the root cause doesn't even lie within our repository, but in external dependencies or unsupported usage (not that I'm saying that's the case here). That's why it's common in other repositories for issues to be rejected if the problem cannot be reproduced and no detailed information is provided.
Yes, this regression was most probably introduced with this commit. Could you please provide us with these information so we can investigate further?
|
Hi all, we've just released a snapshot version ( |
I have tested the snapshot version ( From my side, I'm not sure if further investigation is needed, but here are the answers to your previous questions if they are still needed: Question 1: @qscheitlin it seems like the error is thrown before you navigate to another page, correct? If so, could you please tell us what router you're using.
Question 2: How does the markup of your components look like? Especially I'm curious about the layout options you're using for the FlexibleColumnLayout and if you're using a placeholder of the ObjectPage at any point. For I do not use the placeholder of the Object Page at any point, but some sections of the Question 3: Are you using conditional rendering for a column of the FlexibleColumnLayout, the ObjectPage or any of its subcomponents? Currently, the |
@qscheitlin thanks a lot for testing and answering the questions! I tried again to reproduce it, including routing, conditional rendering, etc. but still didn't get the app to throw. We will release the fix sometime next week and that is of course if @TinaAngeloski and @signavio-fghedina don't find that the bug is not fixed for them. Here you can find the stackBlitz sandbox which I used trying to reproduce the issue in another env: https://stackblitz.com/edit/github-qshwnm?file=src%2FToDos.tsx |
thank you @Lukas742 and @qscheitlin ... actually yesterday I could not really dedicate more time to that, hope next time to be more enabled in the discussion. |
🎉 This issue has been resolved in version v1.26.1 🎉 The release is available on v1.26.1 Your semantic-release bot 📦🚀 |
Bug Description
The ObjectPage renders all ObjectPageSections regardless which sections is active. In our case, we have an ObjectPage with three section, and at the beginning the user sees only the first section. Our app breaks, because in the background it tries to render and load also the other sections which are not visible to the user.
Versions:
The bug happened after we updated to @ui5/webcomponents: ^1.22.0 and @ui5/webcomponents-react: ^1.25.1. Before it was working with versions @ui5/webcomponents: 1.21.2 and @ui5/webcomponents-react: 1.24.0.
Note: The same started happening to FlexibleColumnLayout, and this is the related issue
Affected Component
ObjectPage, FlexibleColumnLayout
Expected Behaviour
It should render only the visible sections as before the update.
Isolated Example
https://stackblitz.com/edit/github-acayej
Steps to Reproduce
Create an object page with multiple sections in tab version. Even if the first one is only visible to the user and selected, all other sections are loaded in the background.
As shown in the isolated example.
Log Output, Stack Trace or Screenshots
Priority
High
UI5 Web Components Version
@ui5/webcomponents-base: ^1.22.0 and @ui5/webcomponents-react: ^1.25.1
Browser
Chrome
Operating System
No response
Additional Context
No response
Organization
SAP Signavio
Declaration
The text was updated successfully, but these errors were encountered: