finos / openfin-react-hooks

A collection of React Hooks built on top of the Openfin API - from Scott Logic
Apache License 2.0
48 stars 18 forks source link

Undocking bounds control #15

Closed jrhenderson1988 closed 5 years ago

jrhenderson1988 commented 5 years ago

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.

Thanks!