Dock handle disappearing after altering size to full screen width or height

I have a dock view which I update the size to match the size of the users screen using system.perspective.alterDock.

When I open the dock it correctly resizes to the screen but when I close the dock to hide it the handles disappear?

It only happens if I resize the dock to full screen ,not if I resize the dock to 80% of the screen width or height.

Share all of your relevant scripts (including the one which closes the Dock).

Here is the onStartup script when the TrendDock is started up

config={'size':self.page.props.dimensions.screen.height}
system.perspective.alterDock('TrendDock', config=config)

Here is the script on the button which closes the dock

system.perspective.toggleDock('TrendDock')

Okay fixed this by removing this from startup.

Created a viewport binding on the view and added a onChange script to update the docksize

Works as intended now