The PluginGui BindToClose method does not override the default closing behavior

The PluginGui:BindToClose method does not override the default closing behavior of plugin widgets.

It is only now that I tried using the BindToClose function to keep the widget open when its close button is pressed, so I’m not sure of the date this issue started happening.

Reproduction steps

  1. Create a script:
local Info = DockWidgetPluginGuiInfo.new(
    Enum.InitialDockState.Float,
    true,
    false
)

local Widget = plugin:CreateDockWidgetPluginGui("ReproWidget", Info)
Widget.Name = "ReproWidget"
Widget.Enabled = true

Widget:BindToClose(function()
    print("The widget should not close.")
end)
  1. Save the script as a local plugin and close the plugin widget that appears after doing so.

Here’s a video of me doing the same with all other plugins disabled:

Studio version

Version 0.605.3.6050660 (64bit)

1 Like

Thanks for the report! We’ll follow up when we have an update for you.

1 Like

@MeshOfPaul Mention because I think this might be in your scope?

2 Likes

We took a closer look at this request and discussed it. Ultimately we decided it’s not a good user experience to allow the override of the closing action.

@zilibobi if there’s something else you’re trying to accomplish here besides a widget that can’t be dismissed by the user, let me know and perhaps we can suggest or support a better approach.