Shortkeys for process export don't work on modeler page
Closed this issue · 2 comments
Describe the bug
When trying to use 'controlenter' in the export modal on the process modeler page, it doesn't submit the form.
To Reproduce
- Open any process
- Click on the export button in the top right
- Click on any option and try to submit with the shortkey.
Additional context
I fixed the bug that happened before, where a reload of the modeler page would crash the site, because the export modal tried to use the 'process-list' control eventhough it wasn't registered. The useAddControlCallback
hook now first checks if the control even exists.
For components like these that are used in multiple pages, we need a more generic solution. I think either let the user provide multiple control ids or have a generic way of creating a new control area if one doesn't exist already.
Additionally, there is currently no way to unregister a control if the user navigates to a new page. The store will just grow over time.
I also just noticed this error popping up occasionally, when you navigate between pages:
It probably has to do with the controlStore.registerControls()
call inside useRegisterControls()
being called outside a useEffect
because it can update state for components while they are being rendered. If this is done to guarantee that the control is set before the callbacks are added, we maybe should change the callbacks to be lazy so that you can add them even if the control is not set yet.