Onshow Event of Conditional Region Fires On Page Load

Wappler Version : 5.5.3
Operating System : W11
Server Model: NodeJS

onshow static event of conditional region fires on page load, even for CRs which are hidden.
The condition I have uses a variable which changes its value based on different actions. Condition is set like var1.value == 0 or var1.value == 1 on each CR.
By default, the value of variable is 0, but still the onshow event fires for all CRs.

Bump.

Another bump. @patrick

Could you do some logging of both show and hide events

onshow="console.log('show', event)" onhide="console.log('hide', event)"

Is the var1 component located at the top of the document or at the bottom, the order of the components can make a difference sometimes.

I have tried the logging part before. Irrespective of the condition, onshow always fires after page load.
I even put in a condition like 1 == 0, which does not show the CR on page, but onshow event is fired first, then onhide.

That is very strange, does the hide trigger also directly after the show was triggered?

Are you sure the show event also runs for the region that’s hidden?
In my tests it only triggers the hide event:

<dmx-value id="var1" dmx-bind:value="1"></dmx-value>
<div id="conditional1" is="dmx-if" dmx-bind:condition="var1.value == 0" onshow="console.log('show', event)" onhide="console.log('hide', event)">test1</div>

Thanks for the quick test there @Teodor
I was running my own as well, and had the same observation.
It seems I got confused between show/hide events. The hide event being called is the problem for me actually.

Will re-work my logic.
Thank you for helping out.

1 Like