This PR adds optional, finer-grained control over the undocking behaviour in the useDockWindow hook. I've added a more generic "options" argument to hook's parameters which could potentially be extended to add further new behaviour to the hook in the future without breaking existing functionality. Specifically, the developer can specify the undockSize (comprised of a width and height - both must be specified for it to be taken into account) and the undockPosition (comprised of top and left - both must be specified for it to be taken into account) options to control the bounds of the window that is undocked.
I've updated the demo page with a quick example, but that can probably be improved further. I haven't had a chance to update the readme or code sample on the demo page just yet. If anyone would like to make those changes before merging this PR, then feel free.
This PR adds optional, finer-grained control over the undocking behaviour in the
useDockWindow
hook. I've added a more generic "options" argument to hook's parameters which could potentially be extended to add further new behaviour to the hook in the future without breaking existing functionality. Specifically, the developer can specify theundockSize
(comprised of awidth
andheight
- both must be specified for it to be taken into account) and theundockPosition
(comprised oftop
andleft
- both must be specified for it to be taken into account) options to control the bounds of the window that is undocked.I've updated the demo page with a quick example, but that can probably be improved further. I haven't had a chance to update the readme or code sample on the demo page just yet. If anyone would like to make those changes before merging this PR, then feel free.
Thanks!