Custom editor expanded event broken?

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [x] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

The onExpanded (expandedChanged) event only fires once when custom editor is loaded. After that it never fires again despite switching expanded mode.

Additionally, tooltip for the expand button mentions “fullscreen mode” instead of “expanded mode”. Is that intentional?

Expected behavior

onExpanded to be fired every time expanded state of a field changes.

Minimal reproduction of the problem

  1. Create a custom editor.

    <!DOCTYPE html>
    <html>
    <head>
        <script src="/scripts/editor-sdk.js"></script>
    </head>
    <body>
        <script>
            const field = new SquidexFormField();
            field.onExpanded((isExpanded) => {
                console.log("onExpanded - isExpanded = ", isExpanded);
            });
            window.addEventListener("message", (event) => {
                console.log("message from the parent = ", event.data);
            });
        </script>
    </body>
    </html>
    
  2. Create a schema with a field pointed at the custom editor.

  3. Create new content for the schema. Click the expand button few times.

  4. See the console. The expanded event was only when editor loaded. Consecutive changes to the expanded state trigger by clicking on the button are not logged.

    onExpanded - isExpanded =  false
    message from the parent =  {type: 'expandedChanged', expanded: false}
    

Environment

App Name: N/A

  • [x] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: 7.4.0

Browser:

  • [x] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

Thanks, I will have a look.

I cannot reproduce it.

There is a log editor. I just have improved it:

Hmm, really? How weird. I took this new editor-log.html and host it locally.

Then set it as custom editor:

This is what I got:

GIF

I’m on latest Chrome on MacOS:

macos-version

I don’t know what you want to show me here. In the textarea you see the events. The first line is that actual event that happened followed by the state of the editor. So you should have multiple “Is Expanded: false”. But if you click expand button a few times, it should show new events, with the updated status.

Initial State:

Expand Clicked:

Expanded Clicked again:

I have also tested it in the cloud to ensure that there is no difference with production build or so.

OK, this is what we see.

  1. We have Squidex Cloud account. From https://cloud.squidex.io/api/info I can see Cloud is on 7.0.0.0. In there editor-log.html as custom editor behaves as expected and as you described - clicking on the expand button logs the “Expanded changed” event and “Is Expanded” holds correct value.

  2. Our hosted Squidex on version 7.4.0.0 with exactly the same setup for custom editor does not work. Clicking on the expand button does not register in the editor.

Same browser (latest Chrome). Tested on both MacOS and Windows.

So to me something has changed between 7.0 and 7.4 but I accept that maybe something about how we host Squidex causes this. I just have no idea what could it be.

The Squidex cloud version is not the same as the self hosted version. It is basically 7.4, but it is a custom fork with same small modifications. I just do not update the version because it slows down the build.

OK, so it is our hosting setup. I remain stumped. I will update here if I figure this out.

1 Like