New-UDTinyMCE - Cannot Type in Modals When Declared Inside New-UDModal

When declaring a New-UDTinyMCE inside of New-UDModal, any modal that TinyMCE opens cannot be typed in.

Modals in TinyMCE work for this:

########################## TinyMCE Full Editor ##########################
        New-UDTypography -Variant 'h5' -Text 'TinyMCE Full Editor'
        New-UDForm -Id 'TinyMCEFormID' -ButtonVariant 'contained' -Content {
            $TinyMCEOptions = @{
                'plugins' = @('advlist', 'autolink', 'link', 'image', 'lists', 'charmap', 'preview', 'anchor', 'pagebreak', 'searchreplace', 'wordcount', 'visualblocks', 'visualchars', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'emoticons', 'template', 'help')
                'toolbar' = 'undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | preview fullscreen | forecolor backcolor emoticons | code | help'
                'menubar' = 'favs file edit view insert format tools table help'
                'icons'   = 'material'
            }
            New-UDElement -Tag 'div' -Attributes @{ 'style' = @{ 'display' = 'none' } } -Content {
                New-UDTextbox -Id 'TinyMCEFullTextID' -Multiline -Value 'Test initial value'
            }
            New-UDTinyMCE -Init $TinyMCEOptions -InitialValue 'Test initial value' -OnEditorChange {
                Set-UDElement -Id 'TinyMCEFullTextID' -Properties @{
                    'value' = $EventData
                }
            }
        } -OnSubmit {
            $EventData.TinyMCEFullTextID | Out-File C:\ProgramData\PowerShellUniversal\TinyFullTest.txt
        }

But not in this:

########################## TinyMCE Inside Modal ##########################
        New-UDTypography -Variant 'h5' -Text 'TinyMCE Inside Modal'
        New-UDButton -Text 'Open Modal' -Id 'btnOpenModal' -OnClick {
            New-UDModal -Content {
                New-UDForm -Id 'TinyMCEFormInsideModalID' -ButtonVariant 'contained' -Content {
                    $TinyMCEOptions = @{
                        'plugins' = @('advlist', 'autolink', 'link', 'image', 'lists', 'charmap', 'preview', 'anchor', 'pagebreak', 'searchreplace', 'wordcount', 'visualblocks', 'visualchars', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'emoticons', 'template', 'help')
                        'toolbar' = 'undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | preview fullscreen | forecolor backcolor emoticons | code | help'
                        'menubar' = 'favs file edit view insert format tools table help'
                        'icons'   = 'material'
                    }
                    New-UDElement -Tag 'div' -Attributes @{ 'style' = @{ 'display' = 'none' } } -Content {
                        New-UDTextbox -Id 'TinyMCEFullInsideModalTextID' -Multiline -Value 'Test initial value'
                    }
                    New-UDTinyMCE -Init $TinyMCEOptions -InitialValue 'Test initial value' -OnEditorChange {
                        Set-UDElement -Id 'TinyMCEFullInsideModalTextID' -Properties @{
                            'value' = $EventData
                        }
                    }
                } -OnSubmit {
                    $EventData.TinyMCEFullInsideModalTextID | Out-File C:\ProgramData\PowerShellUniversal\TinyFullInsideModalTest.txt
                    Hide-UDModal
                }
            }
        }

@Support

Issue created here: New-UDTinyMCE - Cannot Type in Modals When Declared Inside New-UDModal · Issue #2827 · ironmansoftware/issues (github.com)

1 Like