-
Notifications
You must be signed in to change notification settings - Fork 275
ui5-tabcontainer | svelte #8514
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
Note that this is working fine when using pure client side rendering |
Svelte seems to remove attributes it didn't add during its hydration step. We have seen this with other frameworks too. This is what happens:
Basically the custom element logic runs before the hydration is what is causing the problem. I couldn't find a way to modify the svelte behaviour other than turning off SSR completely. So instead as a workaround, if the custom element is defined after the hydration, adding the attribute by the custom element will be ok. I tried this by making all imports dynamic, this way the <script>
import('@ui5/webcomponents/dist/Label.js')
import('@ui5/webcomponents/dist/Tab.js')
import('@ui5/webcomponents/dist/TabContainer')
</script> This seems to fix the issue, but it is not 100% synchronized with the svelte hydration. It would be best if there is a svelte hook for running code after hydration, but I couldn't find any. Please let me know if this works for you. PS. there is a svelte issue without a resolution for this: And the code where the attributes are removed: |
Hello, everyone! The issue has been inactive for 21 days. If there are still questions or comments, please feel free to continue the discussion. Inactive issues will be closed after 7 days! |
Hello, everyone! The issue has been inactive for 28 days, so I am closing the issue. |
Bug Description
ui5-tabcontainer is raising error when switching tab when used in svelte framework
Affected Component
ui5-tabcontainer
Expected Behaviour
we should be able to switch between tabs
Isolated Example
https://github.com/ash-uncover/ui5-webcomponents-svelte-issue
Steps to Reproduce
Log Output, Stack Trace or Screenshots
TabContainerTemplate.lit.ts:15 Uncaught TypeError: Cannot read properties of undefined (reading 'effectiveHidden')
at TabContainer2.block84 (TabContainerTemplate.lit.ts:15:278)
at TabContainer2.block013 (TabContainerTemplate.lit.ts:7:1425)
at executeTemplate (executeTemplate.ts:17:18)
at TabContainer2.render (UI5Element.ts:162:10)
at updateShadowRoot (updateShadowRoot.ts:21:26)
at TabContainer2._render (UI5Element.ts:707:4)
at renderImmediately (Render.ts:44:15)
at RenderQueue.process (RenderQueue.ts:64:4)
at Render.ts:67:30
Priority
High
UI5 Web Components Version
1.23.0
Browser
Chrome
Operating System
No response
Additional Context
No response
Organization
No response
Declaration
The text was updated successfully, but these errors were encountered: