Problem modal in dynamic region

Hi,
I have a problem with the dynamic regions and the modal, I explain.
I have a dynamic region that refreshes every 5 seconds. The dynamic region contains a table.
This table contains buttons that open a modal (example in picture: “Delete”, “Edit” and “Force Check”)
I can open the modal without worry, however, when I click on one of the buttons of the modal (example in picture “Close” or “Submit”) and that the region is refreshed, nothing happens, the buttons do not work anymore
For your information, I don’t have this problem on the 2.7.x versions.
I encounter this problem only from version 2.8.0 and the last version 2.9.0.

if anyone can help me
thanks to you :slight_smile:
and sorry for my English


2022-03-09_18h54_20

Hi @Fox_Zoulou, I would love to help with this (as I’m sure others will too) but could you possibly share some sample code just so I am sure to replicate the issue on my side?

Hi @DataTraveler
thank’s for your help :slight_smile:


New-UDDashboard -Title "Title" -Content {
    $object = '' | select title
    $object.title = 'Titletest'
    $TableCSV = @()
    $TableCSV +=$object
    New-UDDynamic -Id 'data' -Content {


        $Columns = @(
            New-UDTableColumn -Property title  -Width 300
            New-UDTableColumn -Property rowid -Title Action -Render {
  
                New-UDButton -Id "testBTN" -Text "testBTN" -OnClick { 
                    #Show-UDToast -Message $eventdata.rowid 
                    Show-UDModal -Content {    
                        New-UDTypography -Text ("confirm action ?")
                    } -Footer {
                        New-UDButton -Text "Confirm" -OnClick { 
                            Hide-UDModal
                            Sync-UDElement -Id 'data' 
                        } 
                        New-UDButton -Text "Cancel" -OnClick {Hide-UDModal  }
                    
                    }
                }
            }
        )
    New-UDTable -Title "List" -Data $TableCSV -column $Columns -Search
    }  -AutoRefreshInterval 5 -AutoRefresh 
} 

if you use Powershell Universal 2.8.x or higher, click on the “TestBTN” button :

  • if you wait more than 5 seconds, then try to click on “Confirm” or “Cancel”, nothing happens.
  • if you wait less than 5 seconds, you have very high chances that both buttons work (depending on the refresh time of the dynamic region

if you use powershell universal 2.7.x, you can wait as long, you don’t encounter the problem.

1 Like

Hi @Fox_Zoulou,

Sorry for the delay. It was very easy to recreate the issue with your sample code. It seems like you found a discrepancy that has existed since 2.8.x. I raised Issue #1040 to the tracker.

Thank you for posting about this. Kindly subscribe to the issue on the github if you wish to track the progress :eye:

Hi @adam,

Can you please advise if might could be a workaround available for us by changing a setting? For example, I tried increasing JobHandshakeTimeout

JobHandshakeTimeout wont have an effect on this. I’ll have to poke around to see if I have another recommendation.

Hi,
sorry for this delay.
I just have to wait now.
thanks to you :slight_smile: