Atozed Forums
Visibilty of components doesn't seem to work properly with async component creation - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: Visibilty of components doesn't seem to work properly with async component creation (/thread-3357.html)



Visibilty of components doesn't seem to work properly with async component creation - CantuStange - 07-05-2023

Hello,
I've encountered a problem with the visibility of components when creating and destroying other components in async events.
It seems like IntraWeb is generating duplicate style tags for components that changed styles but remained in the page and that breaks their visibility.

I attached a Delphi project that simulates the problem:
  1. Press "Create components".
  2. Press "Destroy components".
  3. The IWtest region (below the red label) is no longer visible even though it should be.
The "List IW Styles" button should list the duplicate styles mentioned above.
If the page is reloaded the region appears as expected.

Am I doing something incorrect in the code or is this a bug?
If it is a bug, is there a workaround or fix in future versions of IntraWeb (I'm using IntraWeb 15.2.69)?


RE: Visibilty of components doesn't seem to work properly with async component creation - Alexandre Machado - 07-06-2023

Interesting test case. It's definitely a bug but not because IW leaves redundant rules in the page... it actually is creating them when there is no need to create them.

I'm working on a fix.


RE: Visibilty of components doesn't seem to work properly with async component creation - Alexandre Machado - 07-10-2023

Please update to 15.3.10 that we have just released and this will be fixed.

Just a note, though: If you install and build the new version you will see that when the object is destroyed during an async event, the CSS rule will be also removed from the style sheet. The underlying IW JavaScript code also removes the empty <style> tag. However the browser refuses to remove it from the style sheet collections of the DOM of the current page, so you might end up with some empty style sheets, which have no undesirable side effects