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
- 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)
- 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)